@pawover/eslint-rules 0.0.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.antfu.js +59 -3
- package/dist/core.imports.js +45 -0
- package/dist/core.javascript.js +980 -0
- package/dist/core.react.js +459 -15
- package/dist/core.reactHooks.js +85 -0
- package/dist/core.stylistic.js +460 -0
- package/dist/core.typescript.js +715 -0
- package/dist/index.js +1 -1
- package/dist/types/core.antfu.d.ts +59 -1
- package/dist/types/core.antfu.d.ts.map +1 -1
- package/dist/types/core.imports.d.ts +45 -0
- package/dist/types/core.imports.d.ts.map +1 -1
- package/dist/types/core.javascript.d.ts +980 -0
- package/dist/types/core.javascript.d.ts.map +1 -1
- package/dist/types/core.react.d.ts +455 -11
- package/dist/types/core.react.d.ts.map +1 -1
- package/dist/types/core.reactHooks.d.ts +85 -0
- package/dist/types/core.reactHooks.d.ts.map +1 -1
- package/dist/types/core.stylistic.d.ts +460 -0
- package/dist/types/core.stylistic.d.ts.map +1 -1
- package/dist/types/core.typescript.d.ts +715 -0
- package/dist/types/core.typescript.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +53 -38
|
@@ -1,33 +1,183 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
/**
|
|
3
|
+
* @desc 强制数组回调函数中必须包含 return 语句
|
|
4
|
+
* @descEN Enforce return statements in callbacks of array methods
|
|
5
|
+
* @see https://eslint.org/docs/latest/rules/array-callback-return
|
|
6
|
+
*/
|
|
2
7
|
"array-callback-return": number;
|
|
8
|
+
/**
|
|
9
|
+
* @desc 确保构造函数中调用了 super()
|
|
10
|
+
* @descEN Require `super()` calls in constructors
|
|
11
|
+
* @see https://eslint.org/docs/latest/rules/constructor-super
|
|
12
|
+
*/
|
|
3
13
|
"constructor-super": number;
|
|
14
|
+
/**
|
|
15
|
+
* @desc 强制 for 循环方向正确
|
|
16
|
+
* @descEN Enforce "for" loop update clause moving the counter in the right direction
|
|
17
|
+
* @see https://eslint.org/docs/latest/rules/for-direction
|
|
18
|
+
*/
|
|
4
19
|
"for-direction": number;
|
|
20
|
+
/**
|
|
21
|
+
* @desc 强制 getter 函数中必须有 return 语句
|
|
22
|
+
* @descEN Enforce that a getter returns a value
|
|
23
|
+
* @see https://eslint.org/docs/latest/rules/getter-return
|
|
24
|
+
*/
|
|
5
25
|
"getter-return": number;
|
|
26
|
+
/**
|
|
27
|
+
* @desc 禁止使用异步函数作为 Promise 执行器
|
|
28
|
+
* @descEN Disallow using an async function as a Promise executor
|
|
29
|
+
* @see https://eslint.org/docs/latest/rules/no-async-promise-executor
|
|
30
|
+
*/
|
|
6
31
|
"no-async-promise-executor": number;
|
|
32
|
+
/**
|
|
33
|
+
* @desc 禁止在循环中使用 await
|
|
34
|
+
* @descEN Disallow `await` inside loops
|
|
35
|
+
* @see https://eslint.org/docs/latest/rules/no-await-in-loop
|
|
36
|
+
*/
|
|
7
37
|
"no-await-in-loop": number;
|
|
38
|
+
/**
|
|
39
|
+
* @desc 禁止给类赋值
|
|
40
|
+
* @descEN Disallow reassigning class members
|
|
41
|
+
* @see https://eslint.org/docs/latest/rules/no-class-assign
|
|
42
|
+
*/
|
|
8
43
|
"no-class-assign": number;
|
|
44
|
+
/**
|
|
45
|
+
* @desc 禁止与 -0 进行比较
|
|
46
|
+
* @descEN Disallow comparing against -0
|
|
47
|
+
* @see https://eslint.org/docs/latest/rules/no-compare-neg-zero
|
|
48
|
+
*/
|
|
9
49
|
"no-compare-neg-zero": number;
|
|
50
|
+
/**
|
|
51
|
+
* @desc 禁止在条件表达式中使用赋值运算符
|
|
52
|
+
* @descEN Disallow assignment operators in conditional expressions
|
|
53
|
+
* @see https://eslint.org/docs/latest/rules/no-cond-assign
|
|
54
|
+
*/
|
|
10
55
|
"no-cond-assign": number;
|
|
56
|
+
/**
|
|
57
|
+
* @desc 禁止修改 const 声明的变量
|
|
58
|
+
* @descEN Disallow reassigning `const` variables
|
|
59
|
+
* @see https://eslint.org/docs/latest/rules/no-const-assign
|
|
60
|
+
*/
|
|
11
61
|
"no-const-assign": number;
|
|
62
|
+
/**
|
|
63
|
+
* @desc 禁止在常量条件、比较和表达式中出现逻辑错误
|
|
64
|
+
* @descEN Disallow expressions where the operation doesn't match the type
|
|
65
|
+
* @see https://eslint.org/docs/latest/rules/no-constant-binary-expression
|
|
66
|
+
*/
|
|
12
67
|
"no-constant-binary-expression": number;
|
|
68
|
+
/**
|
|
69
|
+
* @desc 禁止在条件中使用常量表达式
|
|
70
|
+
* @descEN Disallow constant expressions in conditions
|
|
71
|
+
* @see https://eslint.org/docs/latest/rules/no-constant-condition
|
|
72
|
+
*/
|
|
13
73
|
"no-constant-condition": number;
|
|
74
|
+
/**
|
|
75
|
+
* @desc 禁止构造函数中显式 return 值
|
|
76
|
+
* @descEN Disallow returning a value from a constructor
|
|
77
|
+
* @see https://eslint.org/docs/latest/rules/no-constructor-return
|
|
78
|
+
*/
|
|
14
79
|
"no-constructor-return": number;
|
|
80
|
+
/**
|
|
81
|
+
* @desc 禁止在正则表达式中使用控制字符
|
|
82
|
+
* @descEN Disallow control characters in regular expressions
|
|
83
|
+
* @see https://eslint.org/docs/latest/rules/no-control-regex
|
|
84
|
+
*/
|
|
15
85
|
"no-control-regex": number;
|
|
86
|
+
/**
|
|
87
|
+
* @desc 禁止使用 debugger
|
|
88
|
+
* @descEN Disallow the use of `debugger`
|
|
89
|
+
* @see https://eslint.org/docs/latest/rules/no-debugger
|
|
90
|
+
*/
|
|
16
91
|
"no-debugger": number;
|
|
92
|
+
/**
|
|
93
|
+
* @desc 禁止函数参数重复
|
|
94
|
+
* @descEN Disallow duplicate arguments in function definitions
|
|
95
|
+
* @see https://eslint.org/docs/latest/rules/no-dupe-args
|
|
96
|
+
*/
|
|
17
97
|
"no-dupe-args": number;
|
|
98
|
+
/**
|
|
99
|
+
* @desc 禁止类成员重复
|
|
100
|
+
* @descEN Disallow duplicate class members
|
|
101
|
+
* @see https://eslint.org/docs/latest/rules/no-dupe-class-members
|
|
102
|
+
*/
|
|
18
103
|
"no-dupe-class-members": number;
|
|
104
|
+
/**
|
|
105
|
+
* @desc 禁止 if-else-if 链中出现重复条件
|
|
106
|
+
* @descEN Disallow duplicate conditions in if-else-if chains
|
|
107
|
+
* @see https://eslint.org/docs/latest/rules/no-dupe-else-if
|
|
108
|
+
*/
|
|
19
109
|
"no-dupe-else-if": number;
|
|
110
|
+
/**
|
|
111
|
+
* @desc 禁止对象字面量中出现重复键
|
|
112
|
+
* @descEN Disallow duplicate keys in object literals
|
|
113
|
+
* @see https://eslint.org/docs/latest/rules/no-dupe-keys
|
|
114
|
+
*/
|
|
20
115
|
"no-dupe-keys": number;
|
|
116
|
+
/**
|
|
117
|
+
* @desc 禁止 switch 中出现重复 case
|
|
118
|
+
* @descEN Disallow duplicate case labels
|
|
119
|
+
* @see https://eslint.org/docs/latest/rules/no-duplicate-case
|
|
120
|
+
*/
|
|
21
121
|
"no-duplicate-case": number;
|
|
122
|
+
/**
|
|
123
|
+
* @desc 禁止重复导入
|
|
124
|
+
* @descEN Disallow duplicate imports
|
|
125
|
+
* @see https://eslint.org/docs/latest/rules/no-duplicate-imports
|
|
126
|
+
*/
|
|
22
127
|
"no-duplicate-imports": number;
|
|
128
|
+
/**
|
|
129
|
+
* @desc 禁止在正则字符类中使用空字符
|
|
130
|
+
* @descEN Disallow empty character classes in regular expressions
|
|
131
|
+
* @see https://eslint.org/docs/latest/rules/no-empty-character-class
|
|
132
|
+
*/
|
|
23
133
|
"no-empty-character-class": number;
|
|
134
|
+
/**
|
|
135
|
+
* @desc 禁止解构赋值中出现空模式
|
|
136
|
+
* @descEN Disallow empty destructuring patterns
|
|
137
|
+
* @see https://eslint.org/docs/latest/rules/no-empty-pattern
|
|
138
|
+
*/
|
|
24
139
|
"no-empty-pattern": number;
|
|
140
|
+
/**
|
|
141
|
+
* @desc 禁止对 catch 异常参数赋值
|
|
142
|
+
* @descEN Disallow reassigning exceptions in `catch` clauses
|
|
143
|
+
* @see https://eslint.org/docs/latest/rules/no-ex-assign
|
|
144
|
+
*/
|
|
25
145
|
"no-ex-assign": number;
|
|
146
|
+
/**
|
|
147
|
+
* @desc 禁止 switch 穿透
|
|
148
|
+
* @descEN Disallow fallthrough of `case` statements
|
|
149
|
+
* @see https://eslint.org/docs/latest/rules/no-fallthrough
|
|
150
|
+
*/
|
|
26
151
|
"no-fallthrough": number;
|
|
152
|
+
/**
|
|
153
|
+
* @desc 禁止对函数声明重新赋值
|
|
154
|
+
* @descEN Disallow reassigning function declarations
|
|
155
|
+
* @see https://eslint.org/docs/latest/rules/no-func-assign
|
|
156
|
+
*/
|
|
27
157
|
"no-func-assign": number;
|
|
158
|
+
/**
|
|
159
|
+
* @desc 禁止给导入绑定赋值
|
|
160
|
+
* @descEN Disallow assigning to imported bindings
|
|
161
|
+
* @see https://eslint.org/docs/latest/rules/no-import-assign
|
|
162
|
+
*/
|
|
28
163
|
"no-import-assign": number;
|
|
164
|
+
/**
|
|
165
|
+
* @desc 禁止在嵌套代码块中声明变量或函数
|
|
166
|
+
* @descEN Disallow variable or function declarations in nested blocks
|
|
167
|
+
* @see https://eslint.org/docs/latest/rules/no-inner-declarations
|
|
168
|
+
*/
|
|
29
169
|
"no-inner-declarations": number;
|
|
170
|
+
/**
|
|
171
|
+
* @desc 禁止使用无效的正则表达式
|
|
172
|
+
* @descEN Disallow invalid regular expressions in string literals
|
|
173
|
+
* @see https://eslint.org/docs/latest/rules/no-invalid-regexp
|
|
174
|
+
*/
|
|
30
175
|
"no-invalid-regexp": number;
|
|
176
|
+
/**
|
|
177
|
+
* @desc 禁止不规则的空白字符
|
|
178
|
+
* @descEN Disallow irregular whitespace characters
|
|
179
|
+
* @see https://eslint.org/docs/latest/rules/no-irregular-whitespace
|
|
180
|
+
*/
|
|
31
181
|
"no-irregular-whitespace": (number | {
|
|
32
182
|
skipStrings: boolean;
|
|
33
183
|
skipComments: boolean;
|
|
@@ -35,29 +185,139 @@ declare const _default: {
|
|
|
35
185
|
skipTemplates: boolean;
|
|
36
186
|
skipJSXText: boolean;
|
|
37
187
|
})[];
|
|
188
|
+
/**
|
|
189
|
+
* @desc 禁止数字精度丢失
|
|
190
|
+
* @descEN Disallow literal numbers that lose precision
|
|
191
|
+
* @see https://eslint.org/docs/latest/rules/no-loss-of-precision
|
|
192
|
+
*/
|
|
38
193
|
"no-loss-of-precision": number;
|
|
194
|
+
/**
|
|
195
|
+
* @desc 禁止误导性的字符类
|
|
196
|
+
* @descEN Disallow characters which are made with multiple code points in character class syntax
|
|
197
|
+
* @see https://eslint.org/docs/latest/rules/no-misleading-character-class
|
|
198
|
+
*/
|
|
39
199
|
"no-misleading-character-class": number;
|
|
200
|
+
/**
|
|
201
|
+
* @desc 禁止使用 new 调用非构造函数
|
|
202
|
+
* @descEN Disallow `new` operators with global non-constructor functions
|
|
203
|
+
* @see https://eslint.org/docs/latest/rules/no-new-native-nonconstructor
|
|
204
|
+
*/
|
|
40
205
|
"no-new-native-nonconstructor": number;
|
|
206
|
+
/**
|
|
207
|
+
* @desc 禁止对内置全局对象调用
|
|
208
|
+
* @descEN Disallow calling global object properties as functions
|
|
209
|
+
* @see https://eslint.org/docs/latest/rules/no-obj-calls
|
|
210
|
+
*/
|
|
41
211
|
"no-obj-calls": number;
|
|
212
|
+
/**
|
|
213
|
+
* @desc 禁止在 Promise 执行器中返回值
|
|
214
|
+
* @descEN Disallow returning values from Promise executor functions
|
|
215
|
+
* @see https://eslint.org/docs/latest/rules/no-promise-executor-return
|
|
216
|
+
*/
|
|
42
217
|
"no-promise-executor-return": (number | {
|
|
43
218
|
allowVoid: boolean;
|
|
44
219
|
})[];
|
|
220
|
+
/**
|
|
221
|
+
* @desc 禁止直接调用对象原型上的方法
|
|
222
|
+
* @descEN Disallow calling some `Object.prototype` methods directly on objects
|
|
223
|
+
* @see https://eslint.org/docs/latest/rules/no-prototype-builtins
|
|
224
|
+
*/
|
|
45
225
|
"no-prototype-builtins": number;
|
|
226
|
+
/**
|
|
227
|
+
* @desc 禁止自身赋值
|
|
228
|
+
* @descEN Disallow self-assignment
|
|
229
|
+
* @see https://eslint.org/docs/latest/rules/no-self-assign
|
|
230
|
+
*/
|
|
46
231
|
"no-self-assign": number;
|
|
232
|
+
/**
|
|
233
|
+
* @desc 禁止自身比较
|
|
234
|
+
* @descEN Disallow self-comparison
|
|
235
|
+
* @see https://eslint.org/docs/latest/rules/no-self-compare
|
|
236
|
+
*/
|
|
47
237
|
"no-self-compare": number;
|
|
238
|
+
/**
|
|
239
|
+
* @desc 禁止 setter 返回值
|
|
240
|
+
* @descEN Disallow returning a value from a setter
|
|
241
|
+
* @see https://eslint.org/docs/latest/rules/no-setter-return
|
|
242
|
+
*/
|
|
48
243
|
"no-setter-return": number;
|
|
244
|
+
/**
|
|
245
|
+
* @desc 禁止稀疏数组
|
|
246
|
+
* @descEN Disallow sparse arrays
|
|
247
|
+
* @see https://eslint.org/docs/latest/rules/no-sparse-arrays
|
|
248
|
+
*/
|
|
49
249
|
"no-sparse-arrays": number;
|
|
250
|
+
/**
|
|
251
|
+
* @desc 禁止在字符串中使用模板字面量占位符
|
|
252
|
+
* @descEN Disallow template literal placeholder syntax in regular strings
|
|
253
|
+
* @see https://eslint.org/docs/latest/rules/no-template-curly-in-string
|
|
254
|
+
*/
|
|
50
255
|
"no-template-curly-in-string": number;
|
|
256
|
+
/**
|
|
257
|
+
* @desc 确保在构造函数中调用 super() 之前不能访问 this
|
|
258
|
+
* @descEN Disallow using `this`/`super` before `super()` is called
|
|
259
|
+
* @see https://eslint.org/docs/latest/rules/no-this-before-super
|
|
260
|
+
*/
|
|
51
261
|
"no-this-before-super": number;
|
|
262
|
+
/**
|
|
263
|
+
* @desc 禁止使用未声明的变量
|
|
264
|
+
* @descEN Disallow undeclared variables
|
|
265
|
+
* @see https://eslint.org/docs/latest/rules/no-undef
|
|
266
|
+
*/
|
|
52
267
|
"no-undef": number;
|
|
268
|
+
/**
|
|
269
|
+
* @desc 禁止使用可能引起歧义的多行表达式
|
|
270
|
+
* @descEN Disallow confusing multiline expressions
|
|
271
|
+
* @see https://eslint.org/docs/latest/rules/no-unexpected-multiline
|
|
272
|
+
*/
|
|
53
273
|
"no-unexpected-multiline": number;
|
|
274
|
+
/**
|
|
275
|
+
* @desc 禁止未修改的循环条件
|
|
276
|
+
* @descEN Disallow unmodified loop conditions
|
|
277
|
+
* @see https://eslint.org/docs/latest/rules/no-unmodified-loop-condition
|
|
278
|
+
*/
|
|
54
279
|
"no-unmodified-loop-condition": number;
|
|
280
|
+
/**
|
|
281
|
+
* @desc 禁止无法到达的代码
|
|
282
|
+
* @descEN Disallow unreachable code after control flow statements
|
|
283
|
+
* @see https://eslint.org/docs/latest/rules/no-unreachable
|
|
284
|
+
*/
|
|
55
285
|
"no-unreachable": number;
|
|
286
|
+
/**
|
|
287
|
+
* @desc 禁止只有一次迭代的循环
|
|
288
|
+
* @descEN Disallow loops with a body that allows only one iteration
|
|
289
|
+
* @see https://eslint.org/docs/latest/rules/no-unreachable-loop
|
|
290
|
+
*/
|
|
56
291
|
"no-unreachable-loop": number;
|
|
292
|
+
/**
|
|
293
|
+
* @desc 禁止不安全的 finally 语句
|
|
294
|
+
* @descEN Disallow control flow statements in `finally` blocks
|
|
295
|
+
* @see https://eslint.org/docs/latest/rules/no-unsafe-finally
|
|
296
|
+
*/
|
|
57
297
|
"no-unsafe-finally": number;
|
|
298
|
+
/**
|
|
299
|
+
* @desc 禁止否定运算符与比较运算符混用
|
|
300
|
+
* @descEN Disallow negating the left operand of relational operators
|
|
301
|
+
* @see https://eslint.org/docs/latest/rules/no-unsafe-negation
|
|
302
|
+
*/
|
|
58
303
|
"no-unsafe-negation": number;
|
|
304
|
+
/**
|
|
305
|
+
* @desc 禁止对可选链使用不安全的方式
|
|
306
|
+
* @descEN Disallow assignments that can lead to `undefined` in optional chaining
|
|
307
|
+
* @see https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining
|
|
308
|
+
*/
|
|
59
309
|
"no-unsafe-optional-chaining": number;
|
|
310
|
+
/**
|
|
311
|
+
* @desc 禁止使用未使用的私有类成员
|
|
312
|
+
* @descEN Disallow unused private class members
|
|
313
|
+
* @see https://eslint.org/docs/latest/rules/no-unused-private-class-members
|
|
314
|
+
*/
|
|
60
315
|
"no-unused-private-class-members": number;
|
|
316
|
+
/**
|
|
317
|
+
* @desc 禁止未使用的变量
|
|
318
|
+
* @descEN Disallow unused variables
|
|
319
|
+
* @see https://eslint.org/docs/latest/rules/no-unused-vars
|
|
320
|
+
*/
|
|
61
321
|
"no-unused-vars": (number | {
|
|
62
322
|
vars: string;
|
|
63
323
|
args: string;
|
|
@@ -65,168 +325,888 @@ declare const _default: {
|
|
|
65
325
|
varsIgnorePattern: string;
|
|
66
326
|
destructuredArrayIgnorePattern: string;
|
|
67
327
|
})[];
|
|
328
|
+
/**
|
|
329
|
+
* @desc 禁止在定义之前使用变量
|
|
330
|
+
* @descEN Disallow the use of variables before they are defined
|
|
331
|
+
* @see https://eslint.org/docs/latest/rules/no-use-before-define
|
|
332
|
+
*/
|
|
68
333
|
"no-use-before-define": (number | {
|
|
69
334
|
functions: boolean;
|
|
70
335
|
classes: boolean;
|
|
71
336
|
variables: boolean;
|
|
72
337
|
allowNamedExports: boolean;
|
|
73
338
|
})[];
|
|
339
|
+
/**
|
|
340
|
+
* @desc 禁止无用的赋值
|
|
341
|
+
* @descEN Disallow useless assignments
|
|
342
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-assignment
|
|
343
|
+
*/
|
|
74
344
|
"no-useless-assignment": number;
|
|
345
|
+
/**
|
|
346
|
+
* @desc 禁止正则表达式中无用的反向引用
|
|
347
|
+
* @descEN Disallow useless backreferences in regular expressions
|
|
348
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-backreference
|
|
349
|
+
*/
|
|
75
350
|
"no-useless-backreference": number;
|
|
351
|
+
/**
|
|
352
|
+
* @desc 要求原子更新
|
|
353
|
+
* @descEN Require calls to `await` in atomic update expressions
|
|
354
|
+
* @see https://eslint.org/docs/latest/rules/require-atomic-updates
|
|
355
|
+
*/
|
|
76
356
|
"require-atomic-updates": (number | {
|
|
77
357
|
allowProperties: boolean;
|
|
78
358
|
})[];
|
|
359
|
+
/**
|
|
360
|
+
* @desc 强制使用 isNaN() 检查 NaN
|
|
361
|
+
* @descEN Require calls to `isNaN()` when checking for `NaN`
|
|
362
|
+
* @see https://eslint.org/docs/latest/rules/use-isnan
|
|
363
|
+
*/
|
|
79
364
|
"use-isnan": number;
|
|
365
|
+
/**
|
|
366
|
+
* @desc 强制 typeof 比较值是有效的字符串
|
|
367
|
+
* @descEN Enforce comparing `typeof` expressions against valid strings
|
|
368
|
+
* @see https://eslint.org/docs/latest/rules/valid-typeof
|
|
369
|
+
*/
|
|
80
370
|
"valid-typeof": number;
|
|
371
|
+
/**
|
|
372
|
+
* @desc 强制 getter/setter 成对出现
|
|
373
|
+
* @descEN Enforce getter/setter pairs in objects and classes
|
|
374
|
+
* @see https://eslint.org/docs/latest/rules/accessor-pairs
|
|
375
|
+
*/
|
|
81
376
|
"accessor-pairs": (number | {
|
|
82
377
|
setWithoutGet: boolean;
|
|
83
378
|
getWithoutSet: boolean;
|
|
84
379
|
})[];
|
|
380
|
+
/**
|
|
381
|
+
* @desc 强制箭头函数体风格
|
|
382
|
+
* @descEN Require or disallow braces around arrow function bodies
|
|
383
|
+
* @see https://eslint.org/docs/latest/rules/arrow-body-style
|
|
384
|
+
*/
|
|
85
385
|
"arrow-body-style": number;
|
|
386
|
+
/**
|
|
387
|
+
* @desc 要求变量声明在块级作用域内
|
|
388
|
+
* @descEN Require variables to be declared in the nearest block scope
|
|
389
|
+
* @see https://eslint.org/docs/latest/rules/block-scoped-var
|
|
390
|
+
*/
|
|
86
391
|
"block-scoped-var": number;
|
|
392
|
+
/**
|
|
393
|
+
* @desc 强制驼峰命名规范
|
|
394
|
+
* @descEN Enforce camelcase naming convention
|
|
395
|
+
* @see https://eslint.org/docs/latest/rules/camelcase
|
|
396
|
+
*/
|
|
87
397
|
camelcase: number;
|
|
398
|
+
/**
|
|
399
|
+
* @desc 强制注释首字母大小写
|
|
400
|
+
* @descEN Enforce capitalization of the first letter of a comment
|
|
401
|
+
* @see https://eslint.org/docs/latest/rules/capitalized-comments
|
|
402
|
+
*/
|
|
88
403
|
"capitalized-comments": number;
|
|
404
|
+
/**
|
|
405
|
+
* @desc 强制类方法使用 this
|
|
406
|
+
* @descEN Require class methods to use `this`
|
|
407
|
+
* @see https://eslint.org/docs/latest/rules/class-methods-use-this
|
|
408
|
+
*/
|
|
89
409
|
"class-methods-use-this": number;
|
|
410
|
+
/**
|
|
411
|
+
* @desc 限制代码复杂度
|
|
412
|
+
* @descEN Limit cyclomatic complexity
|
|
413
|
+
* @see https://eslint.org/docs/latest/rules/complexity
|
|
414
|
+
*/
|
|
90
415
|
complexity: number;
|
|
416
|
+
/**
|
|
417
|
+
* @desc 要求一致的 return 语句
|
|
418
|
+
* @descEN Require `return` statements to either always or never specify values
|
|
419
|
+
* @see https://eslint.org/docs/latest/rules/consistent-return
|
|
420
|
+
*/
|
|
91
421
|
"consistent-return": number;
|
|
422
|
+
/**
|
|
423
|
+
* @desc 强制一致的 this 别名
|
|
424
|
+
* @descEN Require or disallow a consistent naming pattern for `this` aliases
|
|
425
|
+
* @see https://eslint.org/docs/latest/rules/consistent-this
|
|
426
|
+
*/
|
|
92
427
|
"consistent-this": number;
|
|
428
|
+
/**
|
|
429
|
+
* @desc 强制花括号风格
|
|
430
|
+
* @descEN Require or disallow braces around all control statements
|
|
431
|
+
* @see https://eslint.org/docs/latest/rules/curly
|
|
432
|
+
*/
|
|
93
433
|
curly: number;
|
|
434
|
+
/**
|
|
435
|
+
* @desc 要求 switch 语句中有 default 分支
|
|
436
|
+
* @descEN Require `default` case in switch statements
|
|
437
|
+
* @see https://eslint.org/docs/latest/rules/default-case
|
|
438
|
+
*/
|
|
94
439
|
"default-case": number;
|
|
440
|
+
/**
|
|
441
|
+
* @desc 要求 default 分支放在最后
|
|
442
|
+
* @descEN Require `default` case to be the last clause in a switch statement
|
|
443
|
+
* @see https://eslint.org/docs/latest/rules/default-case-last
|
|
444
|
+
*/
|
|
95
445
|
"default-case-last": number;
|
|
446
|
+
/**
|
|
447
|
+
* @desc 强制默认参数放在最后
|
|
448
|
+
* @descEN Require default parameters to be last
|
|
449
|
+
* @see https://eslint.org/docs/latest/rules/default-param-last
|
|
450
|
+
*/
|
|
96
451
|
"default-param-last": number;
|
|
452
|
+
/**
|
|
453
|
+
* @desc 强制使用点号表示法
|
|
454
|
+
* @descEN Require dot notation when possible
|
|
455
|
+
* @see https://eslint.org/docs/latest/rules/dot-notation
|
|
456
|
+
*/
|
|
97
457
|
"dot-notation": number;
|
|
458
|
+
/**
|
|
459
|
+
* @desc 强制使用 === 和 !==
|
|
460
|
+
* @descEN Require the use of `===` and `!==`
|
|
461
|
+
* @see https://eslint.org/docs/latest/rules/eqeqeq
|
|
462
|
+
*/
|
|
98
463
|
eqeqeq: number;
|
|
464
|
+
/**
|
|
465
|
+
* @desc 强制函数名与赋值的变量名匹配
|
|
466
|
+
* @descEN Require function names to match the name of the variable to which they are assigned
|
|
467
|
+
* @see https://eslint.org/docs/latest/rules/func-name-matching
|
|
468
|
+
*/
|
|
99
469
|
"func-name-matching": number;
|
|
470
|
+
/**
|
|
471
|
+
* @desc 强制命名函数表达式
|
|
472
|
+
* @descEN Require or disallow named function expressions
|
|
473
|
+
* @see https://eslint.org/docs/latest/rules/func-names
|
|
474
|
+
*/
|
|
100
475
|
"func-names": number;
|
|
476
|
+
/**
|
|
477
|
+
* @desc 强制函数声明与函数表达式的风格
|
|
478
|
+
* @descEN Require or disallow the use of function declarations
|
|
479
|
+
* @see https://eslint.org/docs/latest/rules/func-style
|
|
480
|
+
*/
|
|
101
481
|
"func-style": number;
|
|
482
|
+
/**
|
|
483
|
+
* @desc 强制访问器属性成对出现
|
|
484
|
+
* @descEN Require grouped accessor pairs in object literals and classes
|
|
485
|
+
* @see https://eslint.org/docs/latest/rules/grouped-accessor-pairs
|
|
486
|
+
*/
|
|
102
487
|
"grouped-accessor-pairs": (string | number)[];
|
|
488
|
+
/**
|
|
489
|
+
* @desc 强制 for-in 循环中需要 if 保护
|
|
490
|
+
* @descEN Require `for-in` loops to include an `if` statement
|
|
491
|
+
* @see https://eslint.org/docs/latest/rules/guard-for-in
|
|
492
|
+
*/
|
|
103
493
|
"guard-for-in": number;
|
|
494
|
+
/**
|
|
495
|
+
* @desc 禁止使用指定标识符名称
|
|
496
|
+
* @descEN Disallow specified identifier names
|
|
497
|
+
* @see https://eslint.org/docs/latest/rules/id-denylist
|
|
498
|
+
*/
|
|
104
499
|
"id-denylist": number;
|
|
500
|
+
/**
|
|
501
|
+
* @desc 限制标识符长度
|
|
502
|
+
* @descEN Limit minimum and maximum identifier lengths
|
|
503
|
+
* @see https://eslint.org/docs/latest/rules/id-length
|
|
504
|
+
*/
|
|
105
505
|
"id-length": number;
|
|
506
|
+
/**
|
|
507
|
+
* @desc 强制标识符命名匹配指定模式
|
|
508
|
+
* @descEN Require identifiers to match a specified regular expression
|
|
509
|
+
* @see https://eslint.org/docs/latest/rules/id-match
|
|
510
|
+
*/
|
|
106
511
|
"id-match": number;
|
|
512
|
+
/**
|
|
513
|
+
* @desc 强制变量初始化
|
|
514
|
+
* @descEN Require or disallow initialization in variable declarations
|
|
515
|
+
* @see https://eslint.org/docs/latest/rules/init-declarations
|
|
516
|
+
*/
|
|
107
517
|
"init-declarations": number;
|
|
518
|
+
/**
|
|
519
|
+
* @desc 强制使用逻辑赋值运算符
|
|
520
|
+
* @descEN Require or disallow logical assignment operators
|
|
521
|
+
* @see https://eslint.org/docs/latest/rules/logical-assignment-operators
|
|
522
|
+
*/
|
|
108
523
|
"logical-assignment-operators": number;
|
|
524
|
+
/**
|
|
525
|
+
* @desc 限制单个文件中的类数量
|
|
526
|
+
* @descEN Limit the number of classes per file
|
|
527
|
+
* @see https://eslint.org/docs/latest/rules/max-classes-per-file
|
|
528
|
+
*/
|
|
109
529
|
"max-classes-per-file": number;
|
|
530
|
+
/**
|
|
531
|
+
* @desc 限制代码块嵌套深度
|
|
532
|
+
* @descEN Enforce a maximum depth that blocks can be nested
|
|
533
|
+
* @see https://eslint.org/docs/latest/rules/max-depth
|
|
534
|
+
*/
|
|
110
535
|
"max-depth": number[];
|
|
536
|
+
/**
|
|
537
|
+
* @desc 限制文件行数
|
|
538
|
+
* @descEN Enforce a maximum number of lines per file
|
|
539
|
+
* @see https://eslint.org/docs/latest/rules/max-lines
|
|
540
|
+
*/
|
|
111
541
|
"max-lines": number;
|
|
542
|
+
/**
|
|
543
|
+
* @desc 限制函数中的行数
|
|
544
|
+
* @descEN Enforce a maximum number of lines per function
|
|
545
|
+
* @see https://eslint.org/docs/latest/rules/max-lines-per-function
|
|
546
|
+
*/
|
|
112
547
|
"max-lines-per-function": number;
|
|
548
|
+
/**
|
|
549
|
+
* @desc 限制回调嵌套深度
|
|
550
|
+
* @descEN Enforce a maximum depth that callbacks can be nested
|
|
551
|
+
* @see https://eslint.org/docs/latest/rules/max-nested-callbacks
|
|
552
|
+
*/
|
|
113
553
|
"max-nested-callbacks": number;
|
|
554
|
+
/**
|
|
555
|
+
* @desc 限制参数数量
|
|
556
|
+
* @descEN Enforce a maximum number of parameters in function definitions
|
|
557
|
+
* @see https://eslint.org/docs/latest/rules/max-params
|
|
558
|
+
*/
|
|
114
559
|
"max-params": number;
|
|
560
|
+
/**
|
|
561
|
+
* @desc 限制函数中的语句数量
|
|
562
|
+
* @descEN Enforce a maximum number of statements allowed in function blocks
|
|
563
|
+
* @see https://eslint.org/docs/latest/rules/max-statements
|
|
564
|
+
*/
|
|
115
565
|
"max-statements": number;
|
|
566
|
+
/**
|
|
567
|
+
* @desc 要求构造函数名以大写字母开头
|
|
568
|
+
* @descEN Require constructor names to begin with a capital letter
|
|
569
|
+
* @see https://eslint.org/docs/latest/rules/new-cap
|
|
570
|
+
*/
|
|
116
571
|
"new-cap": (number | {
|
|
117
572
|
capIsNew: boolean;
|
|
118
573
|
})[];
|
|
574
|
+
/**
|
|
575
|
+
* @desc 禁止使用 alert
|
|
576
|
+
* @descEN Disallow the use of `alert`, `confirm`, and `prompt`
|
|
577
|
+
* @see https://eslint.org/docs/latest/rules/no-alert
|
|
578
|
+
*/
|
|
119
579
|
"no-alert": number;
|
|
580
|
+
/**
|
|
581
|
+
* @desc 禁止使用 Array 构造函数
|
|
582
|
+
* @descEN Disallow `Array` constructors
|
|
583
|
+
* @see https://eslint.org/docs/latest/rules/no-array-constructor
|
|
584
|
+
*/
|
|
120
585
|
"no-array-constructor": number;
|
|
586
|
+
/**
|
|
587
|
+
* @desc 禁止使用位运算符
|
|
588
|
+
* @descEN Disallow bitwise operators
|
|
589
|
+
* @see https://eslint.org/docs/latest/rules/no-bitwise
|
|
590
|
+
*/
|
|
121
591
|
"no-bitwise": number;
|
|
592
|
+
/**
|
|
593
|
+
* @desc 禁止使用 caller 或 callee
|
|
594
|
+
* @descEN Disallow the use of `arguments.caller` or `arguments.callee`
|
|
595
|
+
* @see https://eslint.org/docs/latest/rules/no-caller
|
|
596
|
+
*/
|
|
122
597
|
"no-caller": number;
|
|
598
|
+
/**
|
|
599
|
+
* @desc 禁止在 case/default 子句中使用词法声明
|
|
600
|
+
* @descEN Disallow lexical declarations in case/default clauses
|
|
601
|
+
* @see https://eslint.org/docs/latest/rules/no-case-declarations
|
|
602
|
+
*/
|
|
123
603
|
"no-case-declarations": number;
|
|
604
|
+
/**
|
|
605
|
+
* @desc 禁止使用 console
|
|
606
|
+
* @descEN Disallow the use of `console`
|
|
607
|
+
* @see https://eslint.org/docs/latest/rules/no-console
|
|
608
|
+
*/
|
|
124
609
|
"no-console": number;
|
|
610
|
+
/**
|
|
611
|
+
* @desc 禁止使用 continue
|
|
612
|
+
* @descEN Disallow the use of `continue`
|
|
613
|
+
* @see https://eslint.org/docs/latest/rules/no-continue
|
|
614
|
+
*/
|
|
125
615
|
"no-continue": number;
|
|
616
|
+
/**
|
|
617
|
+
* @desc 禁止删除变量
|
|
618
|
+
* @descEN Disallow deleting variables
|
|
619
|
+
* @see https://eslint.org/docs/latest/rules/no-delete-var
|
|
620
|
+
*/
|
|
126
621
|
"no-delete-var": number;
|
|
622
|
+
/**
|
|
623
|
+
* @desc 禁止使用正则除法标记
|
|
624
|
+
* @descEN Disallow division operators which might be confused with regular expressions
|
|
625
|
+
* @see https://eslint.org/docs/latest/rules/no-div-regex
|
|
626
|
+
*/
|
|
127
627
|
"no-div-regex": number;
|
|
628
|
+
/**
|
|
629
|
+
* @desc 禁止在 else 分支中使用 return
|
|
630
|
+
* @descEN Disallow `else` blocks after `return` statements in `if` blocks
|
|
631
|
+
* @see https://eslint.org/docs/latest/rules/no-else-return
|
|
632
|
+
*/
|
|
128
633
|
"no-else-return": number;
|
|
634
|
+
/**
|
|
635
|
+
* @desc 禁止空块语句
|
|
636
|
+
* @descEN Disallow empty block statements
|
|
637
|
+
* @see https://eslint.org/docs/latest/rules/no-empty
|
|
638
|
+
*/
|
|
129
639
|
"no-empty": (number | {
|
|
130
640
|
allowEmptyCatch: boolean;
|
|
131
641
|
})[];
|
|
642
|
+
/**
|
|
643
|
+
* @desc 禁止空函数
|
|
644
|
+
* @descEN Disallow empty functions
|
|
645
|
+
* @see https://eslint.org/docs/latest/rules/no-empty-function
|
|
646
|
+
*/
|
|
132
647
|
"no-empty-function": number;
|
|
648
|
+
/**
|
|
649
|
+
* @desc 禁止空静态代码块
|
|
650
|
+
* @descEN Disallow empty static blocks
|
|
651
|
+
* @see https://eslint.org/docs/latest/rules/no-empty-static-block
|
|
652
|
+
*/
|
|
133
653
|
"no-empty-static-block": number;
|
|
654
|
+
/**
|
|
655
|
+
* @desc 禁止使用 == 与 null 比较
|
|
656
|
+
* @descEN Disallow `==` and `!=` comparisons against `null`
|
|
657
|
+
* @see https://eslint.org/docs/latest/rules/no-eq-null
|
|
658
|
+
*/
|
|
134
659
|
"no-eq-null": number;
|
|
660
|
+
/**
|
|
661
|
+
* @desc 禁止使用 eval
|
|
662
|
+
* @descEN Disallow the use of `eval()`
|
|
663
|
+
* @see https://eslint.org/docs/latest/rules/no-eval
|
|
664
|
+
*/
|
|
135
665
|
"no-eval": number;
|
|
666
|
+
/**
|
|
667
|
+
* @desc 禁止扩展原生对象
|
|
668
|
+
* @descEN Disallow extending native types
|
|
669
|
+
* @see https://eslint.org/docs/latest/rules/no-extend-native
|
|
670
|
+
*/
|
|
136
671
|
"no-extend-native": number;
|
|
672
|
+
/**
|
|
673
|
+
* @desc 禁止不必要的函数绑定
|
|
674
|
+
* @descEN Disallow unnecessary calls to `.bind()`
|
|
675
|
+
* @see https://eslint.org/docs/latest/rules/no-extra-bind
|
|
676
|
+
*/
|
|
137
677
|
"no-extra-bind": number;
|
|
678
|
+
/**
|
|
679
|
+
* @desc 禁止不必要的布尔类型转换
|
|
680
|
+
* @descEN Disallow unnecessary boolean casts
|
|
681
|
+
* @see https://eslint.org/docs/latest/rules/no-extra-boolean-cast
|
|
682
|
+
*/
|
|
138
683
|
"no-extra-boolean-cast": number;
|
|
684
|
+
/**
|
|
685
|
+
* @desc 禁止不必要的标签
|
|
686
|
+
* @descEN Disallow unnecessary labels
|
|
687
|
+
* @see https://eslint.org/docs/latest/rules/no-extra-label
|
|
688
|
+
*/
|
|
139
689
|
"no-extra-label": number;
|
|
690
|
+
/**
|
|
691
|
+
* @desc 禁止对全局对象赋值
|
|
692
|
+
* @descEN Disallow assignments to native objects or read-only global variables
|
|
693
|
+
* @see https://eslint.org/docs/latest/rules/no-global-assign
|
|
694
|
+
*/
|
|
140
695
|
"no-global-assign": number;
|
|
696
|
+
/**
|
|
697
|
+
* @desc 禁止隐式类型转换
|
|
698
|
+
* @descEN Disallow shorthand type conversions
|
|
699
|
+
* @see https://eslint.org/docs/latest/rules/no-implicit-coercion
|
|
700
|
+
*/
|
|
141
701
|
"no-implicit-coercion": (number | {
|
|
142
702
|
allow: string[];
|
|
143
703
|
})[];
|
|
704
|
+
/**
|
|
705
|
+
* @desc 禁止隐式全局变量
|
|
706
|
+
* @descEN Disallow declarations in the global scope
|
|
707
|
+
* @see https://eslint.org/docs/latest/rules/no-implicit-globals
|
|
708
|
+
*/
|
|
144
709
|
"no-implicit-globals": number;
|
|
710
|
+
/**
|
|
711
|
+
* @desc 禁止隐式 eval
|
|
712
|
+
* @descEN Disallow the use of `eval()`-like methods
|
|
713
|
+
* @see https://eslint.org/docs/latest/rules/no-implied-eval
|
|
714
|
+
*/
|
|
145
715
|
"no-implied-eval": number;
|
|
716
|
+
/**
|
|
717
|
+
* @desc 禁止行内注释
|
|
718
|
+
* @descEN Disallow inline comments after code
|
|
719
|
+
* @see https://eslint.org/docs/latest/rules/no-inline-comments
|
|
720
|
+
*/
|
|
146
721
|
"no-inline-comments": number;
|
|
722
|
+
/**
|
|
723
|
+
* @desc 禁止无效的 this
|
|
724
|
+
* @descEN Disallow use of `this` in contexts where the value of `this` is `undefined`
|
|
725
|
+
* @see https://eslint.org/docs/latest/rules/no-invalid-this
|
|
726
|
+
*/
|
|
147
727
|
"no-invalid-this": number;
|
|
728
|
+
/**
|
|
729
|
+
* @desc 禁止使用 __iterator__
|
|
730
|
+
* @descEN Disallow the use of the `__iterator__` property
|
|
731
|
+
* @see https://eslint.org/docs/latest/rules/no-iterator
|
|
732
|
+
*/
|
|
148
733
|
"no-iterator": number;
|
|
734
|
+
/**
|
|
735
|
+
* @desc 禁止 label 与变量同名
|
|
736
|
+
* @descEN Disallow labels that share a name with a variable
|
|
737
|
+
* @see https://eslint.org/docs/latest/rules/no-label-var
|
|
738
|
+
*/
|
|
149
739
|
"no-label-var": number;
|
|
740
|
+
/**
|
|
741
|
+
* @desc 禁止使用标签语句
|
|
742
|
+
* @descEN Disallow labeled statements
|
|
743
|
+
* @see https://eslint.org/docs/latest/rules/no-labels
|
|
744
|
+
*/
|
|
150
745
|
"no-labels": number;
|
|
746
|
+
/**
|
|
747
|
+
* @desc 禁止不必要的代码块
|
|
748
|
+
* @descEN Disallow unnecessary nested blocks
|
|
749
|
+
* @see https://eslint.org/docs/latest/rules/no-lone-blocks
|
|
750
|
+
*/
|
|
151
751
|
"no-lone-blocks": number;
|
|
752
|
+
/**
|
|
753
|
+
* @desc 禁止 if 作为唯一语句的 else 块
|
|
754
|
+
* @descEN Disallow `if` statements as the only statement in `else` blocks
|
|
755
|
+
* @see https://eslint.org/docs/latest/rules/no-lonely-if
|
|
756
|
+
*/
|
|
152
757
|
"no-lonely-if": number;
|
|
758
|
+
/**
|
|
759
|
+
* @desc 禁止在循环中使用函数声明
|
|
760
|
+
* @descEN Disallow function declarations inside loops
|
|
761
|
+
* @see https://eslint.org/docs/latest/rules/no-loop-func
|
|
762
|
+
*/
|
|
153
763
|
"no-loop-func": number;
|
|
764
|
+
/**
|
|
765
|
+
* @desc 禁止使用魔术数字
|
|
766
|
+
* @descEN Disallow magic numbers
|
|
767
|
+
* @see https://eslint.org/docs/latest/rules/no-magic-numbers
|
|
768
|
+
*/
|
|
154
769
|
"no-magic-numbers": number;
|
|
770
|
+
/**
|
|
771
|
+
* @desc 禁止连续赋值
|
|
772
|
+
* @descEN Disallow chained assignments
|
|
773
|
+
* @see https://eslint.org/docs/latest/rules/no-multi-assign
|
|
774
|
+
*/
|
|
155
775
|
"no-multi-assign": number;
|
|
776
|
+
/**
|
|
777
|
+
* @desc 禁止多行字符串
|
|
778
|
+
* @descEN Disallow multiline strings
|
|
779
|
+
* @see https://eslint.org/docs/latest/rules/no-multi-str
|
|
780
|
+
*/
|
|
156
781
|
"no-multi-str": number;
|
|
782
|
+
/**
|
|
783
|
+
* @desc 禁止否定条件
|
|
784
|
+
* @descEN Disallow negated conditions
|
|
785
|
+
* @see https://eslint.org/docs/latest/rules/no-negated-condition
|
|
786
|
+
*/
|
|
157
787
|
"no-negated-condition": number;
|
|
788
|
+
/**
|
|
789
|
+
* @desc 禁止嵌套三元表达式
|
|
790
|
+
* @descEN Disallow nested ternary expressions
|
|
791
|
+
* @see https://eslint.org/docs/latest/rules/no-nested-ternary
|
|
792
|
+
*/
|
|
158
793
|
"no-nested-ternary": number;
|
|
794
|
+
/**
|
|
795
|
+
* @desc 禁止使用 new 而不赋值
|
|
796
|
+
* @descEN Disallow `new` operators outside of assignments or comparisons
|
|
797
|
+
* @see https://eslint.org/docs/latest/rules/no-new
|
|
798
|
+
*/
|
|
159
799
|
"no-new": number;
|
|
800
|
+
/**
|
|
801
|
+
* @desc 禁止使用 new Function
|
|
802
|
+
* @descEN Disallow `new Function()` expressions
|
|
803
|
+
* @see https://eslint.org/docs/latest/rules/no-new-func
|
|
804
|
+
*/
|
|
160
805
|
"no-new-func": number;
|
|
806
|
+
/**
|
|
807
|
+
* @desc 禁止使用原始包装类型
|
|
808
|
+
* @descEN Disallow `new` operators with the `String`, `Number`, and `Boolean` objects
|
|
809
|
+
* @see https://eslint.org/docs/latest/rules/no-new-wrappers
|
|
810
|
+
*/
|
|
161
811
|
"no-new-wrappers": number;
|
|
812
|
+
/**
|
|
813
|
+
* @desc 禁止八进制转义符中的无意义数字
|
|
814
|
+
* @descEN Disallow `\8` and `\9` escape sequences in string literals
|
|
815
|
+
* @see https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape
|
|
816
|
+
*/
|
|
162
817
|
"no-nonoctal-decimal-escape": number;
|
|
818
|
+
/**
|
|
819
|
+
* @desc 禁止使用 Object 构造函数
|
|
820
|
+
* @descEN Disallow `Object` constructors
|
|
821
|
+
* @see https://eslint.org/docs/latest/rules/no-object-constructor
|
|
822
|
+
*/
|
|
163
823
|
"no-object-constructor": number;
|
|
824
|
+
/**
|
|
825
|
+
* @desc 禁止使用八进制字面量
|
|
826
|
+
* @descEN Disallow octal literals
|
|
827
|
+
* @see https://eslint.org/docs/latest/rules/no-octal
|
|
828
|
+
*/
|
|
164
829
|
"no-octal": number;
|
|
830
|
+
/**
|
|
831
|
+
* @desc 禁止八进制转义序列
|
|
832
|
+
* @descEN Disallow octal escape sequences in string literals
|
|
833
|
+
* @see https://eslint.org/docs/latest/rules/no-octal-escape
|
|
834
|
+
*/
|
|
165
835
|
"no-octal-escape": number;
|
|
836
|
+
/**
|
|
837
|
+
* @desc 禁止重新分配函数参数
|
|
838
|
+
* @descEN Disallow reassigning function parameters
|
|
839
|
+
* @see https://eslint.org/docs/latest/rules/no-param-reassign
|
|
840
|
+
*/
|
|
166
841
|
"no-param-reassign": number;
|
|
842
|
+
/**
|
|
843
|
+
* @desc 禁止使用 ++ 和 --
|
|
844
|
+
* @descEN Disallow the unary operators `++` and `--`
|
|
845
|
+
* @see https://eslint.org/docs/latest/rules/no-plusplus
|
|
846
|
+
*/
|
|
167
847
|
"no-plusplus": number;
|
|
848
|
+
/**
|
|
849
|
+
* @desc 禁止使用 __proto__
|
|
850
|
+
* @descEN Disallow the use of the `__proto__` property
|
|
851
|
+
* @see https://eslint.org/docs/latest/rules/no-proto
|
|
852
|
+
*/
|
|
168
853
|
"no-proto": number;
|
|
854
|
+
/**
|
|
855
|
+
* @desc 禁止重复声明变量
|
|
856
|
+
* @descEN Disallow variable redeclaration
|
|
857
|
+
* @see https://eslint.org/docs/latest/rules/no-redeclare
|
|
858
|
+
*/
|
|
169
859
|
"no-redeclare": number;
|
|
860
|
+
/**
|
|
861
|
+
* @desc 禁止正则表达式中的空格
|
|
862
|
+
* @descEN Disallow multiple spaces in regular expression literals
|
|
863
|
+
* @see https://eslint.org/docs/latest/rules/no-regex-spaces
|
|
864
|
+
*/
|
|
170
865
|
"no-regex-spaces": number;
|
|
866
|
+
/**
|
|
867
|
+
* @desc 禁止受限的导出名称
|
|
868
|
+
* @descEN Disallow specified names in exports
|
|
869
|
+
* @see https://eslint.org/docs/latest/rules/no-restricted-exports
|
|
870
|
+
*/
|
|
171
871
|
"no-restricted-exports": number;
|
|
872
|
+
/**
|
|
873
|
+
* @desc 禁止受限的全局变量
|
|
874
|
+
* @descEN Disallow specified global variables
|
|
875
|
+
* @see https://eslint.org/docs/latest/rules/no-restricted-globals
|
|
876
|
+
*/
|
|
172
877
|
"no-restricted-globals": number;
|
|
878
|
+
/**
|
|
879
|
+
* @desc 禁止受限的导入
|
|
880
|
+
* @descEN Disallow specified modules when loaded by `import`
|
|
881
|
+
* @see https://eslint.org/docs/latest/rules/no-restricted-imports
|
|
882
|
+
*/
|
|
173
883
|
"no-restricted-imports": number;
|
|
884
|
+
/**
|
|
885
|
+
* @desc 禁止受限的属性
|
|
886
|
+
* @descEN Disallow certain properties on certain objects
|
|
887
|
+
* @see https://eslint.org/docs/latest/rules/no-restricted-properties
|
|
888
|
+
*/
|
|
174
889
|
"no-restricted-properties": number;
|
|
890
|
+
/**
|
|
891
|
+
* @desc 禁止受限的语法
|
|
892
|
+
* @descEN Disallow specified syntax
|
|
893
|
+
* @see https://eslint.org/docs/latest/rules/no-restricted-syntax
|
|
894
|
+
*/
|
|
175
895
|
"no-restricted-syntax": number;
|
|
896
|
+
/**
|
|
897
|
+
* @desc 强制 return 赋值
|
|
898
|
+
* @descEN Disallow assignment in `return` statements
|
|
899
|
+
* @see https://eslint.org/docs/latest/rules/no-return-assign
|
|
900
|
+
*/
|
|
176
901
|
"no-return-assign": (string | number)[];
|
|
902
|
+
/**
|
|
903
|
+
* @desc 禁止使用 javascript: URL
|
|
904
|
+
* @descEN Disallow `javascript:` URLs
|
|
905
|
+
* @see https://eslint.org/docs/latest/rules/no-script-url
|
|
906
|
+
*/
|
|
177
907
|
"no-script-url": number;
|
|
908
|
+
/**
|
|
909
|
+
* @desc 禁止使用逗号表达式
|
|
910
|
+
* @descEN Disallow comma operators
|
|
911
|
+
* @see https://eslint.org/docs/latest/rules/no-sequences
|
|
912
|
+
*/
|
|
178
913
|
"no-sequences": number;
|
|
914
|
+
/**
|
|
915
|
+
* @desc 禁止变量声明覆盖外层作用域
|
|
916
|
+
* @descEN Disallow variable declarations from shadowing outer scope variables
|
|
917
|
+
* @see https://eslint.org/docs/latest/rules/no-shadow
|
|
918
|
+
*/
|
|
179
919
|
"no-shadow": number;
|
|
920
|
+
/**
|
|
921
|
+
* @desc 禁止遮蔽受限的标识符
|
|
922
|
+
* @descEN Disallow identifiers from shadowing restricted names
|
|
923
|
+
* @see https://eslint.org/docs/latest/rules/no-shadow-restricted-names
|
|
924
|
+
*/
|
|
180
925
|
"no-shadow-restricted-names": number;
|
|
926
|
+
/**
|
|
927
|
+
* @desc 禁止使用三元表达式
|
|
928
|
+
* @descEN Disallow ternary operators
|
|
929
|
+
* @see https://eslint.org/docs/latest/rules/no-ternary
|
|
930
|
+
*/
|
|
181
931
|
"no-ternary": number;
|
|
932
|
+
/**
|
|
933
|
+
* @desc 禁止抛出字面量
|
|
934
|
+
* @descEN Disallow throwing literals as exceptions
|
|
935
|
+
* @see https://eslint.org/docs/latest/rules/no-throw-literal
|
|
936
|
+
*/
|
|
182
937
|
"no-throw-literal": number;
|
|
938
|
+
/**
|
|
939
|
+
* @desc 禁止将 undefined 赋值给变量
|
|
940
|
+
* @descEN Disallow initializing variables to `undefined`
|
|
941
|
+
* @see https://eslint.org/docs/latest/rules/no-undef-init
|
|
942
|
+
*/
|
|
183
943
|
"no-undef-init": number;
|
|
944
|
+
/**
|
|
945
|
+
* @desc 禁止使用 undefined
|
|
946
|
+
* @descEN Disallow the use of `undefined` as an identifier
|
|
947
|
+
* @see https://eslint.org/docs/latest/rules/no-undefined
|
|
948
|
+
*/
|
|
184
949
|
"no-undefined": number;
|
|
950
|
+
/**
|
|
951
|
+
* @desc 禁止标识符有前导或尾随下划线
|
|
952
|
+
* @descEN Disallow dangling underscores in identifiers
|
|
953
|
+
* @see https://eslint.org/docs/latest/rules/no-underscore-dangle
|
|
954
|
+
*/
|
|
185
955
|
"no-underscore-dangle": number;
|
|
956
|
+
/**
|
|
957
|
+
* @desc 禁止不必要的三元表达式
|
|
958
|
+
* @descEN Disallow ternary operators when simpler alternatives exist
|
|
959
|
+
* @see https://eslint.org/docs/latest/rules/no-unneeded-ternary
|
|
960
|
+
*/
|
|
186
961
|
"no-unneeded-ternary": number;
|
|
962
|
+
/**
|
|
963
|
+
* @desc 禁止未使用的表达式
|
|
964
|
+
* @descEN Disallow unused expressions
|
|
965
|
+
* @see https://eslint.org/docs/latest/rules/no-unused-expressions
|
|
966
|
+
*/
|
|
187
967
|
"no-unused-expressions": (number | {
|
|
188
968
|
ignoreDirectives: boolean;
|
|
189
969
|
allowShortCircuit: boolean;
|
|
190
970
|
})[];
|
|
971
|
+
/**
|
|
972
|
+
* @desc 禁止未使用的标签
|
|
973
|
+
* @descEN Disallow unused labels
|
|
974
|
+
* @see https://eslint.org/docs/latest/rules/no-unused-labels
|
|
975
|
+
*/
|
|
191
976
|
"no-unused-labels": number;
|
|
977
|
+
/**
|
|
978
|
+
* @desc 禁止不必要的函数调用
|
|
979
|
+
* @descEN Disallow unnecessary calls to `.call()` and `.apply()`
|
|
980
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-call
|
|
981
|
+
*/
|
|
192
982
|
"no-useless-call": number;
|
|
983
|
+
/**
|
|
984
|
+
* @desc 禁止不必要的 catch 语句
|
|
985
|
+
* @descEN Disallow unnecessary `catch` clauses
|
|
986
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-catch
|
|
987
|
+
*/
|
|
193
988
|
"no-useless-catch": number;
|
|
989
|
+
/**
|
|
990
|
+
* @desc 禁止不必要的计算属性键
|
|
991
|
+
* @descEN Disallow unnecessary computed property keys
|
|
992
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-computed-key
|
|
993
|
+
*/
|
|
194
994
|
"no-useless-computed-key": number;
|
|
995
|
+
/**
|
|
996
|
+
* @desc 禁止无用的字符串拼接
|
|
997
|
+
* @descEN Disallow unnecessary concatenation of literals or template literals
|
|
998
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-concat
|
|
999
|
+
*/
|
|
195
1000
|
"no-useless-concat": number;
|
|
1001
|
+
/**
|
|
1002
|
+
* @desc 禁止无用的构造函数
|
|
1003
|
+
* @descEN Disallow unnecessary constructors
|
|
1004
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-constructor
|
|
1005
|
+
*/
|
|
196
1006
|
"no-useless-constructor": number;
|
|
1007
|
+
/**
|
|
1008
|
+
* @desc 禁止不必要的转义
|
|
1009
|
+
* @descEN Disallow unnecessary escape characters
|
|
1010
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-escape
|
|
1011
|
+
*/
|
|
197
1012
|
"no-useless-escape": number;
|
|
1013
|
+
/**
|
|
1014
|
+
* @desc 禁止不必要的重命名
|
|
1015
|
+
* @descEN Disallow renaming import/export/destructured assignments
|
|
1016
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-rename
|
|
1017
|
+
*/
|
|
198
1018
|
"no-useless-rename": number;
|
|
1019
|
+
/**
|
|
1020
|
+
* @desc 禁止多余的 return
|
|
1021
|
+
* @descEN Disallow redundant return statements
|
|
1022
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-return
|
|
1023
|
+
*/
|
|
199
1024
|
"no-useless-return": number;
|
|
1025
|
+
/**
|
|
1026
|
+
* @desc 禁止使用 var
|
|
1027
|
+
* @descEN Require `let` or `const` instead of `var`
|
|
1028
|
+
* @see https://eslint.org/docs/latest/rules/no-var
|
|
1029
|
+
*/
|
|
200
1030
|
"no-var": number;
|
|
1031
|
+
/**
|
|
1032
|
+
* @desc 禁止使用 void
|
|
1033
|
+
* @descEN Disallow the use of `void` operators
|
|
1034
|
+
* @see https://eslint.org/docs/latest/rules/no-void
|
|
1035
|
+
*/
|
|
201
1036
|
"no-void": number;
|
|
1037
|
+
/**
|
|
1038
|
+
* @desc 禁止警告注释
|
|
1039
|
+
* @descEN Disallow specified warning terms in comments
|
|
1040
|
+
* @see https://eslint.org/docs/latest/rules/no-warning-comments
|
|
1041
|
+
*/
|
|
202
1042
|
"no-warning-comments": number;
|
|
1043
|
+
/**
|
|
1044
|
+
* @desc 禁止使用 with
|
|
1045
|
+
* @descEN Disallow `with` statements
|
|
1046
|
+
* @see https://eslint.org/docs/latest/rules/no-with
|
|
1047
|
+
*/
|
|
203
1048
|
"no-with": number;
|
|
1049
|
+
/**
|
|
1050
|
+
* @desc 强制对象字面量简写语法
|
|
1051
|
+
* @descEN Require or disallow object literal shorthand syntax
|
|
1052
|
+
* @see https://eslint.org/docs/latest/rules/object-shorthand
|
|
1053
|
+
*/
|
|
204
1054
|
"object-shorthand": number;
|
|
1055
|
+
/**
|
|
1056
|
+
* @desc 强制变量声明风格
|
|
1057
|
+
* @descEN Enforce the use of `let` or `const` or `var` per declaration
|
|
1058
|
+
* @see https://eslint.org/docs/latest/rules/one-var
|
|
1059
|
+
*/
|
|
205
1060
|
"one-var": (string | number)[];
|
|
1061
|
+
/**
|
|
1062
|
+
* @desc 强制使用复合赋值运算符
|
|
1063
|
+
* @descEN Require or disallow assignment operator shorthand
|
|
1064
|
+
* @see https://eslint.org/docs/latest/rules/operator-assignment
|
|
1065
|
+
*/
|
|
206
1066
|
"operator-assignment": number;
|
|
1067
|
+
/**
|
|
1068
|
+
* @desc 强制使用箭头函数作为回调
|
|
1069
|
+
* @descEN Require using arrow functions for callbacks
|
|
1070
|
+
* @see https://eslint.org/docs/latest/rules/prefer-arrow-callback
|
|
1071
|
+
*/
|
|
207
1072
|
"prefer-arrow-callback": number;
|
|
1073
|
+
/**
|
|
1074
|
+
* @desc 优先使用 const
|
|
1075
|
+
* @descEN Require `const` declarations for variables that are never reassigned
|
|
1076
|
+
* @see https://eslint.org/docs/latest/rules/prefer-const
|
|
1077
|
+
*/
|
|
208
1078
|
"prefer-const": number;
|
|
1079
|
+
/**
|
|
1080
|
+
* @desc 优先使用解构赋值
|
|
1081
|
+
* @descEN Require destructuring from arrays and/or objects
|
|
1082
|
+
* @see https://eslint.org/docs/latest/rules/prefer-destructuring
|
|
1083
|
+
*/
|
|
209
1084
|
"prefer-destructuring": number;
|
|
1085
|
+
/**
|
|
1086
|
+
* @desc 优先使用指数运算符
|
|
1087
|
+
* @descEN Disallow the use of `Math.pow()` in favor of `**`
|
|
1088
|
+
* @see https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
|
|
1089
|
+
*/
|
|
210
1090
|
"prefer-exponentiation-operator": number;
|
|
1091
|
+
/**
|
|
1092
|
+
* @desc 优先使用命名捕获组
|
|
1093
|
+
* @descEN Require named capture groups in regular expressions
|
|
1094
|
+
* @see https://eslint.org/docs/latest/rules/prefer-named-capture-group
|
|
1095
|
+
*/
|
|
211
1096
|
"prefer-named-capture-group": number;
|
|
1097
|
+
/**
|
|
1098
|
+
* @desc 优先使用数字字面量
|
|
1099
|
+
* @descEN Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals
|
|
1100
|
+
* @see https://eslint.org/docs/latest/rules/prefer-numeric-literals
|
|
1101
|
+
*/
|
|
212
1102
|
"prefer-numeric-literals": number;
|
|
1103
|
+
/**
|
|
1104
|
+
* @desc 优先使用 Object.hasOwn
|
|
1105
|
+
* @descEN Disallow `Object.prototype.hasOwnProperty.call()` in favor of `Object.hasOwn()`
|
|
1106
|
+
* @see https://eslint.org/docs/latest/rules/prefer-object-has-own
|
|
1107
|
+
*/
|
|
213
1108
|
"prefer-object-has-own": number;
|
|
1109
|
+
/**
|
|
1110
|
+
* @desc 优先使用对象展开运算符
|
|
1111
|
+
* @descEN Disallow using `Object.assign()` with an object literal as the first argument
|
|
1112
|
+
* @see https://eslint.org/docs/latest/rules/prefer-object-spread
|
|
1113
|
+
*/
|
|
214
1114
|
"prefer-object-spread": number;
|
|
1115
|
+
/**
|
|
1116
|
+
* @desc 优先使用 Promise.reject() 抛出错误
|
|
1117
|
+
* @descEN Require using Error objects as Promise rejection reasons
|
|
1118
|
+
* @see https://eslint.org/docs/latest/rules/prefer-promise-reject-errors
|
|
1119
|
+
*/
|
|
215
1120
|
"prefer-promise-reject-errors": number;
|
|
1121
|
+
/**
|
|
1122
|
+
* @desc 优先使用正则字面量
|
|
1123
|
+
* @descEN Disallow use of the `RegExp` constructor in favor of regular expression literals
|
|
1124
|
+
* @see https://eslint.org/docs/latest/rules/prefer-regex-literals
|
|
1125
|
+
*/
|
|
216
1126
|
"prefer-regex-literals": number;
|
|
1127
|
+
/**
|
|
1128
|
+
* @desc 优先使用剩余参数
|
|
1129
|
+
* @descEN Require rest parameters instead of `arguments`
|
|
1130
|
+
* @see https://eslint.org/docs/latest/rules/prefer-rest-params
|
|
1131
|
+
*/
|
|
217
1132
|
"prefer-rest-params": number;
|
|
1133
|
+
/**
|
|
1134
|
+
* @desc 优先使用展开语法
|
|
1135
|
+
* @descEN Require spread operators instead of `.apply()`
|
|
1136
|
+
* @see https://eslint.org/docs/latest/rules/prefer-spread
|
|
1137
|
+
*/
|
|
218
1138
|
"prefer-spread": number;
|
|
1139
|
+
/**
|
|
1140
|
+
* @desc 优先使用模板字符串
|
|
1141
|
+
* @descEN Require template literals instead of string concatenation
|
|
1142
|
+
* @see https://eslint.org/docs/latest/rules/prefer-template
|
|
1143
|
+
*/
|
|
219
1144
|
"prefer-template": number;
|
|
1145
|
+
/**
|
|
1146
|
+
* @desc 强制使用 parseInt 时指定基数
|
|
1147
|
+
* @descEN Require the use of the second argument in `parseInt()`
|
|
1148
|
+
* @see https://eslint.org/docs/latest/rules/radix
|
|
1149
|
+
*/
|
|
220
1150
|
radix: number;
|
|
1151
|
+
/**
|
|
1152
|
+
* @desc 禁用不必要的 await
|
|
1153
|
+
* @descEN Disallow `await` inside of `async` functions when there is no useful work
|
|
1154
|
+
* @see https://eslint.org/docs/latest/rules/require-await
|
|
1155
|
+
*/
|
|
221
1156
|
"require-await": number;
|
|
1157
|
+
/**
|
|
1158
|
+
* @desc 强制在正则表达式中使用 u 或 v 标志
|
|
1159
|
+
* @descEN Require the use of the `u` or `v` flag in regular expressions
|
|
1160
|
+
* @see https://eslint.org/docs/latest/rules/require-unicode-regexp
|
|
1161
|
+
*/
|
|
222
1162
|
"require-unicode-regexp": number;
|
|
1163
|
+
/**
|
|
1164
|
+
* @desc 要求 generator 函数中有 yield
|
|
1165
|
+
* @descEN Require `yield` statements in generator functions
|
|
1166
|
+
* @see https://eslint.org/docs/latest/rules/require-yield
|
|
1167
|
+
*/
|
|
223
1168
|
"require-yield": number;
|
|
1169
|
+
/**
|
|
1170
|
+
* @desc 强制 import 排序
|
|
1171
|
+
* @descEN Enforce sorted import declarations
|
|
1172
|
+
* @see https://eslint.org/docs/latest/rules/sort-imports
|
|
1173
|
+
*/
|
|
224
1174
|
"sort-imports": number;
|
|
1175
|
+
/**
|
|
1176
|
+
* @desc 强制对象键排序
|
|
1177
|
+
* @descEN Require object keys to be sorted
|
|
1178
|
+
* @see https://eslint.org/docs/latest/rules/sort-keys
|
|
1179
|
+
*/
|
|
225
1180
|
"sort-keys": number;
|
|
1181
|
+
/**
|
|
1182
|
+
* @desc 强制变量排序
|
|
1183
|
+
* @descEN Require variables within the same declaration block to be sorted
|
|
1184
|
+
* @see https://eslint.org/docs/latest/rules/sort-vars
|
|
1185
|
+
*/
|
|
226
1186
|
"sort-vars": number;
|
|
1187
|
+
/**
|
|
1188
|
+
* @desc 强制严格模式
|
|
1189
|
+
* @descEN Require or disallow strict mode directives
|
|
1190
|
+
* @see https://eslint.org/docs/latest/rules/strict
|
|
1191
|
+
*/
|
|
227
1192
|
strict: number;
|
|
1193
|
+
/**
|
|
1194
|
+
* @desc 要求 Symbol 描述
|
|
1195
|
+
* @descEN Require symbol descriptions
|
|
1196
|
+
* @see https://eslint.org/docs/latest/rules/symbol-description
|
|
1197
|
+
*/
|
|
228
1198
|
"symbol-description": number;
|
|
1199
|
+
/**
|
|
1200
|
+
* @desc 要求 var 声明在作用域顶部
|
|
1201
|
+
* @descEN Require `var` declarations to be placed at the top of their containing scope
|
|
1202
|
+
* @see https://eslint.org/docs/latest/rules/vars-on-top
|
|
1203
|
+
*/
|
|
229
1204
|
"vars-on-top": number;
|
|
1205
|
+
/**
|
|
1206
|
+
* @desc 强制比较运算符风格
|
|
1207
|
+
* @descEN Require or disallow "yoda" conditions
|
|
1208
|
+
* @see https://eslint.org/docs/latest/rules/yoda
|
|
1209
|
+
*/
|
|
230
1210
|
yoda: (string | number | {
|
|
231
1211
|
onlyEquality: boolean;
|
|
232
1212
|
})[];
|