https://github.com/fengyinchao/eslint-plugin-custom
一个自定义规则的 ESLint Plugin,用于规范代码
https://github.com/fengyinchao/eslint-plugin-custom
angular change eslint-rules ngrx rxjs6 typescript
Last synced: 6 months ago
JSON representation
一个自定义规则的 ESLint Plugin,用于规范代码
- Host: GitHub
- URL: https://github.com/fengyinchao/eslint-plugin-custom
- Owner: fengyinchao
- License: mit
- Created: 2020-10-08T15:19:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-24T11:11:44.000Z (almost 4 years ago)
- Last Synced: 2024-04-25T01:20:41.052Z (about 2 years ago)
- Topics: angular, change, eslint-rules, ngrx, rxjs6, typescript
- Language: TypeScript
- Homepage:
- Size: 144 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-custom
这是一个自定义规则的 ESLint Plugin,用于规范业务代码,当前支持规则有:
- [x] style-generate
RN中辅助生成 styles.xxx
- [x] scrollview-flatlist-sectionlist-use-scrollIndicatorInsets
RN 中的组件 scrollview flatlist sectionlist 需要显示使用 scrollIndicatorInsets 属性以规避 ios12 上的问题
- [x] file-header-annotation
文件头必须要有注释
- [x] no-first
rxjs 中不允许使用 no-first
- [x] no-useless-optional-chain
ngrx reducer 中创建 selector 时不要冗余使用可选链特性
- [x] normal-timer
electron 渲染进程中使用 setTimeout/setInterval 要加 window, 以区分 nodejs
- [x] use-onpush
Angular 组件请使用 onpush 而非 default
- [x] extract-log-url
Angular 组件中打日志时 clog 参数请使用枚举,支持将 clog 参数自动提取生成枚举文件
## Installation
```
$ npm install @fengyinchao/eslint-plugin-custom --save-dev
```
## Usage
Add `@fengyinchao/custom` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": ["@fengyinchao/custom"]
}
```
Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"@fengyinchao/custom/rule-name": 2
}
}
```