-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
42 lines (42 loc) · 1.28 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
module.exports = {
extends: [
"alloy",
"alloy/react",
"alloy/typescript",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended",
],
globals: {
// 这里填入你的项目需要的全局变量
// 这里值为 false 表示这个全局变量不允许被重新赋值,比如:
__dirname: false,
},
rules: {
"no-undefined": "warn",
"no-debugger": "off",
complexity: ["error", { max: 99 }],
// 这里填入你的项目需要的个性化配置,比如:
// @fixable 一个缩进必须用两个空格替代
indent: [
1,
2,
{
SwitchCase: 1,
flatTernaryExpressions: true,
},
],
// @fixable jsx 的 children 缩进必须为两个空格
"react/jsx-indent": [1, 2],
// @fixable jsx 的 props 缩进必须为两个空格
"react/jsx-indent-props": [1, 2],
"react/no-string-refs": 1, // 不要使用ref
"no-template-curly-in-string": 1, // 在string里面不要出现模板符号
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/no-duplicate-imports": "off",
"react/no-unsafe": "off",
"@typescript-eslint/no-invalid-this": "off",
"react/jsx-key": 0,
"no-undef": 0,
},
};