-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy path.eslintrc.cjs
69 lines (67 loc) · 1.74 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module.exports = {
env: {
browser: true,
es2022: true,
},
extends: [
"standard",
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: ['@typescript-eslint', 'react'],
rules: {
'react/react-in-jsx-scope': 'off',
"max-lines-per-function": ["error", {max: 500}],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off", //关闭any类型警告
"import/prefer-default-export": "off",
"@typescript-eslint/naming-convention": "off",
"import/no-extraneous-dependencies": "off",
"no-empty": 0,
"react-hooks/exhaustive-deps": 0,
"import/extensions": 0,
"import/no-default-export": "off",
'react/jsx-no-target-blank': 0,
// 方法后跟一个空格
"space-before-function-paren": 0,
'multiline-ternary': 0,
"no-new": 0,
'import/order': [
'error',
{
// 对导入模块进行分组
"groups": [
"builtin",
"external",
["internal", "parent", "sibling", "index"],
["type", "unknown"],
],
pathGroups: [
{
pattern: './*.less',
group: 'index',
position: 'after',
},
{
pattern: './*.css',
group: 'index',
position: 'after',
},
],
// 不同组之间是否进行换行
'newlines-between': 'always',
// 根据字母顺序对每个组内的顺序进行排序
alphabetize: {
order: 'asc',
caseInsensitive: true
}
}
]
},
};