|
7 | 7 | "airbnb",
|
8 | 8 | "plugin:import/errors",
|
9 | 9 | "plugin:import/warnings",
|
| 10 | + "plugin:react/recommended", |
10 | 11 | // ts项目可能跟eslint规则冲突,这个插件就是解决这个问题的
|
11 | 12 | // 注意优先级
|
12 |
| - "plugin:react/recommended", |
13 | 13 | "plugin:@typescript-eslint/recommended",
|
14 | 14 | "prettier", // 可能会覆盖eslint-config-airbnb的rule配置 不需要prettier/airbnb 理清楚这种关系 ===>基础配置
|
15 | 15 | "plugin:prettier/recommended"
|
|
82 | 82 | ],
|
83 | 83 | "@typescript-eslint/type-annotation-spacing": "off",
|
84 | 84 | "@typescript-eslint/unified-signatures": "error",
|
| 85 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
85 | 86 | "arrow-body-style": "error",
|
86 | 87 | "arrow-parens": ["off", "as-needed"],
|
87 | 88 | "camelcase": "off",
|
|
136 | 137 | "no-throw-literal": "error",
|
137 | 138 | "no-trailing-spaces": "off",
|
138 | 139 | "no-undef-init": "error",
|
| 140 | + " no-plusplus":"off", |
| 141 | + " no-await-in-loop":"off", |
139 | 142 | "class-methods-use-this": "off",
|
140 |
| - // "no-underscore-dangle": [ |
141 |
| - // "error", |
142 |
| - // { |
143 |
| - // "allow": [ |
144 |
| - // "__INITIAL_DATA__", |
145 |
| - // "__STORE__", |
146 |
| - // "_insertCss", |
147 |
| - // "__SERVER__", |
148 |
| - // "__IS_PROD__", |
149 |
| - // "__IS_SSR__", |
150 |
| - // "_getContent" |
151 |
| - // ], |
152 |
| - // "allowAfterThis": true, |
153 |
| - // "allowAfterThisConstructor": true |
154 |
| - // } |
155 |
| - // ], |
156 | 143 | "no-underscore-dangle": "off",
|
157 | 144 | "no-unsafe-finally": "error",
|
158 | 145 | "no-unused-expressions": [
|
|
223 | 210 | "react-hooks/rules-of-hooks": "error", // 检查 Hook 的规则
|
224 | 211 | "react-hooks/exhaustive-deps": "warn", // 检查 effect 的依赖
|
225 | 212 | "react/jsx-filename-extension": [2, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }]
|
226 |
| - } |
227 |
| - // "overrides": [ |
228 |
| - // { |
229 |
| - // "files": ["global.d.ts", "css.modules.d.ts", "pro-config.ts"], |
230 |
| - // "rules": { |
231 |
| - // "@typescript-eslint/naming-convention": "off" |
232 |
| - // } |
233 |
| - // } |
234 |
| - // ] |
| 213 | + }, |
| 214 | + "overrides": [ |
| 215 | + { |
| 216 | + // enable the rule specifically for TypeScript files |
| 217 | + "files": ["*.js", "*.ts"], |
| 218 | + "rules": { |
| 219 | + "@typescript-eslint/explicit-module-boundary-types": ["error"] |
| 220 | + } |
| 221 | + } |
| 222 | + ] |
235 | 223 | }
|
0 commit comments