-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.json
191 lines (191 loc) · 3.79 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
{
"root": true,
"env": {
"node": true
},
"extends": [
"airbnb-base",
"plugin:vue/vue3-essential",
"plugin:@typescript-eslint/recommended",
"eslint:recommended",
"@vue/typescript"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly",
"lodash": true,
"_": true,
"moment": true,
"systemCode": true,
"systemConfig": true,
"ActiveXObject": true
},
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"sourceType": "module"
},
"plugins": [
"vue",
"@typescript-eslint"
],
"rules": {
"vue/multi-word-component-names": 0,
"no-console": "warn",
"no-debugger": "warn",
"global-require": 0,
"vue/multi-word-component-names": 0, // 忽略Vue组件名错误
"indent": [
"error",
4
],
"array-bracket-spacing": [
2,
"never"
],
"block-scoped-var": 0,
"brace-style": [
2,
"1tbs",
{
"allowSingleLine": true
}
],
"camelcase": 2,
"comma-dangle": [
2,
"never"
],
"comma-spacing": [
2,
{
"before": false,
"after": true
}
],
"comma-style": [
2,
"last"
],
"complexity": [
2,
40
],
"computed-property-spacing": [
2,
"never"
],
"default-case": 2,
"dot-location": [
2,
"property"
],
"dot-notation": [
2,
{
"allowKeywords": true
}
],
"eol-last": 2,
"eqeqeq": [
2,
"allow-null"
],
"import/no-unresolved": [
2,
{
"ignore": [
""
]
}
],
"import/extensions": [
"error",
{
"js": "never",
"vue": "never"
}
],
"max-len": [
"error",
{
"code": 500
}
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
],
"arrow-parens": "off",
"no-param-reassign": [
"error",
{
"props": false
}
],
"no-plusplus": 0,
"linebreak-style": [
0,
"error",
"windows"
],
"no-underscore-dangle": [
0,
{
"allow": [
"_place"
]
}
],
"consistent-return": [
0,
{
"treatUndefinedAsUnspecified": true
}
],
"no-unused-vars": "off",
"one-var": [
"error",
{
"var": "always",
"let": "always"
}
],
"one-var-declaration-per-line": [
"error",
"initializations"
],
"no-return-assign": [
"error",
"always"
],
"no-prototype-builtins": "off",
"no-shadow": "off",
"prefer-destructuring": [
"error",
{
"object": true,
"array": false
}
],
"radix": [
"error",
"as-needed"
],
"no-case-declarations": "off",
"no-nested-ternary": "off",
"no-lonely-if": "off",
"operator-assignment": "off",
"object-curly-newline": "off",
"class-methods-use-this": "off",
"@typescript-eslint/no-empty-function": "off", // 允许空函数
"@typescript-eslint/ban-ts-comment": "off", // 允许使用ts-ignore注释代码块,忽略类型检测
"@typescript-eslint/no-unused-vars": "off", // 允许声明变量,不使用
"@typescript-eslint/no-explicit-any": "off", // 允许使用any来解决类型问题(不推荐)
"@typescript-eslint/ban-types": "off", // 允许使用object来代替任何对象的类型(适用范围为变量,不推荐)
"@typescript-eslint/no-inferrable-types": "off", // 允许在明确的数据类型前继续添加类型
"@typescript-eslint/explicit-module-boundary-types": "off" // 允许函数参数为any类型(不推荐)
}
}