@afuteam/eslint-plugin-fe
@afuteam/eslint-plugin-fe
安装
安装 ESLint 和 @afuteam/eslint-plugin-fe:
npm i eslint @afuteam/eslint-plugin-fe --save-dev
.eslintrc 文件使用
在 .eslintrc 配置文件中, 引入 @afuteam/eslint-plugin-fe 插件
{
"plugins": ["@afuteam/fe"]
}
然后根据项目类型, 配置对应规则
// js + react
{
"extends": [
"plugin:@afuteam/fe/react-js"
],
"plugins": ["@afuteam/fe"]
}
// js + vue2
{
"extends": ["plugin:@afuteam/fe/vue2-js"],
"plugins": ["@afuteam/fe"]
}
// js + vue3
{
"extends": ["plugin:@afuteam/fe/vue3-js"],
"plugins": ["@afuteam/fe"]
}
// ts + react 包含js规则
{
"extends": [
"plugin:@afuteam/fe/react-ts"
],
"plugins": ["@afuteam/fe"]
}
// ts + vue2 包含js规则
{
"plugins": ["@afuteam/fe"],
"extends": ["plugin:@afuteam/fe/vue2-ts"]
}
// ts + vue3 包含js规则
{
"plugins": ["@afuteam/fe"],
"extends": ["plugin:@afuteam/fe/vue3-ts"]
}
npx方式使用
查看当前支持的类型,列出清单
npx @afuteam/eslint-plugin-fe@latest --help=type
使用
npx @afuteam/eslint-plugin-fe@latest --type=react-ts --path=src/
Tips
2.0.7
- 关闭默认的
complexity; - 基于
complexity新增规则complexity-without-switchcase,需要配合@afuteam/fe的plugin使用
2.0.1
- 默认禁止lint 的行内disable注释;但支持npx方式来打开 --allowInlineConfig=true
- 忽略 min.js iconfont.js 结尾的js文件
Related Packages
@anoesj/eslint-config-vue-ts
Anoesj's ESLint config for Vue and Nuxt projects with TypeScript
1,603
0
Version History
| Version | Released | License |
|---|---|---|
| 2.0.10 | MIT | |
| 2.0.9 | MIT | |
| 2.0.8 | MIT | |
| 2.0.7 | MIT | |
| 2.0.6 | MIT | |
| 2.0.5 | MIT | |
| 2.0.4 | MIT | |
| 2.0.3 | MIT | |
| 2.0.2 | MIT | |
| 2.0.1 | MIT | |
| 2.0.0 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT | |
| 0.0.8 | ISC | |
| 0.0.7 | ISC | |
| 0.0.5 | ISC | |
| 0.0.4 | ISC | |
| 0.0.3 | ISC | |
| 0.0.2 | ISC | |
| 0.0.1 | ISC |
Pre-releases (21)
| Version | Released | License |
|---|---|---|
| 2.0.6-beta-4 | MIT | |
| 2.0.6-beta-3 | MIT | |
| 2.0.6-beta-2 | MIT | |
| 2.0.5-beta.12 | MIT | |
| 2.0.5-beta.11 | MIT | |
| 2.0.5-beta.10 | MIT | |
| 2.0.5-beta.9 | MIT | |
| 2.0.5-beta.8 | MIT | |
| 2.0.5-beta.7 | MIT | |
| 2.0.5-beta.6 | MIT | |
| 2.0.5-beta.5 | MIT | |
| 2.0.5-beta.3 | MIT | |
| 2.0.5-beta.2 | MIT | |
| 2.0.5-beta.1 | MIT | |
| 2.0.4-beta.1 | MIT | |
| 2.0.0-alpha.2 | MIT | |
| 2.0.0-alpha.1 | MIT | |
| 0.0.9-beta-7 | MIT | |
| 0.0.9-beta-6 | MIT | |
| 0.0.9-beta-5 | MIT | |
| 0.0.9-beta-2 | MIT |