Socket
Book a DemoInstallSign in
Socket

@rx-now/eslint-plugin

Package Overview
Dependencies
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rx-now/eslint-plugin

ESLint plugin for rx applications

1.0.0
latest
npmnpm
Version published
Weekly downloads
27
1250%
Maintainers
4
Weekly downloads
 
Created
Source

@rx-now/eslint-plugin

一个用于规范项目代码结构和内容格式的 ESLint 插件,提供了一系列规则来确保代码的清晰性、一致性和可维护性。

Install

通过 npm 安装插件:

npm install @rx-now/eslint-plugin -D

Usage

FLat Config

// eslint.config.js
import { defineConfig } from "eslint/config";
import rx from '@rx-now/eslint-plugin';

export default defineConfig({
  extends: [
    rx.configs.recommended,
  ],
  rules: {
    "@rx-now/domain-import": ["error", { /* Options */ }],
    "@rx-now/folder-naming": ["error", { /* Options */ }],
    "@rx-now/folder-naming-with-ext": ["error", { /* Options */ }],
    "@rx-now/file-naming": ["error", { /* Options */ }],
    "@rx-now/zhlint-comment": ["warn"],
    "@rx-now/zhlint-jsx": ["warn"],
    "@rx-now/zhlint-string": ["warn"]
  }
});

Legacy Config

{
  "plugins": ["@rx-now"],
  "rules": {
    "@rx-now/domain-import": ["error", { }],
    "@rx-now/folder-naming": ["error", { }],
    "@rx-now/folder-naming-with-ext": ["error", { }],
    "@rx-now/file-naming": ["error", { }],
    "@rx-now/zhlint-comment": ["warn"],
    "@rx-now/zhlint-jsx": ["warn"],
    "@rx-now/zhlint-string": ["warn"]
  }
}

Rules

@rx-now/domain-import

  • 用途:检查项目中的文件依赖关系,确保不同 domain 之间的依赖符合规范。
  • 配置选项:支持 excludeexcludedDomainslayerConfig

@rx-now/folder-naming

  • 用途:约束特定文件夹的命名风格,确保文件夹命名符合 kebab-case 规范。
  • 配置选项:支持 rootignorePatterns

@rx-now/folder-naming-with-ext

  • 用途:约束特定文件所在的文件夹命名风格,主要用于 Angular 项目。
  • 配置选项:支持 root

@rx-now/file-naming

  • 用途:约束特定文件的文件命名风格,确保文件命名符合 kebab-case 规范。
  • 配置选项:支持 root

@rx-now/zhlint-comment

  • 用途:检查代码中的中文注释是否符合规范。
  • 配置选项:无。

@rx-now/zhlint-jsx

  • 用途:检查 JSX 代码中的中文文本内容是否符合规范。
  • 配置选项:无。

@rx-now/zhlint-string

  • 用途:检查 JavaScript/TypeScript 代码中的字符串内容是否符合中文文本格式规范。
  • 配置选项:无。

详细文档

每个规则的详细配置和说明请参考 docs/rules 目录下的文档。

Keywords

eslint

FAQs

Package last updated on 24 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.