-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
44 lines (44 loc) · 1.08 KB
/
.eslintrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module.exports = {
env: {
// browser: true,
es2021: true,
node: true,
// browser: true,
commonjs: true,
amd: true
},
settings: {
react: {
version: "detect"
}
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
// // 1. 接入 prettier 的规则
"prettier",
"plugin:prettier/recommended"
],
parser: "@typescript-eslint/parser",
ignorePatterns: ["dist", ".eslintrc.cjs"],
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: "latest",
sourceType: "module"
},
// 2. 加入 prettier 的 eslint 插件
plugins: ["react", "@typescript-eslint", "prettier"],
rules: {
// 3. 注意要加上这一句,开启 prettier 自动修复的功能
"prettier/prettier": "error",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off"
// quotes: ['error', 'single'],
// semi: ['error', 'never'],
// 'react/react-in-jsx-scope': 'off'
}
}