-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.json
66 lines (65 loc) · 1.73 KB
/
.eslintrc.json
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
{
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"eslint-config-prettier"
],
"plugins": [
"prettier"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",// 允许使用 any 类型
"@typescript-eslint/ban-ts-comment": "off", //允许使用@ts-ignore
"@typescript-eslint/no-non-null-assertion": "off", //允许使用非空断言
"@typescript-eslint/no-var-requires": "off", //允许使用CommonJS的写法
"no-console": [
//提交时不允许有console.log
"warn",
{
"allow": [
"warn",
"error"
]
}
],
"no-debugger": "warn",
"import/order": [
"error",
{
//按照分组顺序进行排序
"groups": ["builtin", "external", "parent", "sibling", "index", "internal", "object", "type"],
//通过路径自定义分组
"pathGroups": [
{
"pattern": "react*",
"group": "builtin",
"position": "before"
},
{
"pattern": "@/components/**",
"group": "parent",
"position": "before"
},
{
"pattern": "@/utils/**",
"group": "parent",
"position": "after"
},
{
"pattern": "@/apis/**",
"group": "parent",
"position": "after"
}
],
"pathGroupsExcludedImportTypes": ["react"],
"newlines-between": "always", //每个分组之间换行
//根据字母顺序对每个组内的顺序进行排序
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
]
}
}