-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.js
286 lines (251 loc) · 6.68 KB
/
errors.js
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
module.exports = {
rules: {
/**
* Enforce “for” loop update clause moving the counter in the right direction.
*
* https://eslint.org/docs/rules/for-direction
*/
"for-direction": "error",
/**
* Enforce return statements in getters.
*
* https://eslint.org/docs/rules/getter-return
*/
"getter-return": ["error", {
"allowImplicit": true,
}],
/**
* Disallow using an async function as a Promise executor.
*
* https://eslint.org/docs/rules/no-async-promise-executor
*/
"no-async-promise-executor": "error",
/**
* Disallow await inside of loops.
*
* https://eslint.org/docs/rules/no-await-in-loop
*/
"no-await-in-loop": "error",
/**
* Disallow comparing against -0.
*
* https://eslint.org/docs/rules/no-compare-neg-zero
*/
"no-compare-neg-zero": "error",
/**
* Disallow assignment operators in conditional expressions.
*
* https://eslint.org/docs/rules/no-cond-assign
*/
"no-cond-assign": "error",
/**
* Disallow the use of console.
*
* https://eslint.org/docs/rules/no-console
*/
"no-console": "error",
/**
* Disallow constant expressions in conditions.
*
* https://eslint.org/docs/rules/no-constant-condition
*/
"no-constant-condition": ["error", {
"checkLoops": true,
}],
/**
* Disallow control characters in regular expressions.
*
* https://eslint.org/docs/rules/no-control-regex
*/
"no-control-regex": "error",
/**
* Disallow the use of debugger.
*
* https://eslint.org/docs/rules/no-debugger
*/
"no-debugger": "error",
/**
* Disallow duplicate arguments in function definitions.
*
* https://eslint.org/docs/rules/no-dupe-args
*/
"no-dupe-args": "error",
/**
* Disallow duplicate keys in object literals.
*
* https://eslint.org/docs/rules/no-dupe-keys
*/
"no-dupe-keys": "error",
/**
* Disallow duplicate case labels.
*
* https://eslint.org/docs/rules/no-duplicate-case
*/
"no-duplicate-case": "error",
/**
* Disallow empty block statements.
*
* https://eslint.org/docs/rules/no-empty
*/
"no-empty": ["error", {
"allowEmptyCatch": false,
}],
/**
* Disallow empty character classes in regular expressions.
*
* https://eslint.org/docs/rules/no-empty-character-class
*/
"no-empty-character-class": "error",
/**
* Disallow reassigning exceptions in catch clauses.
*
* https://eslint.org/docs/rules/no-ex-assign
*/
"no-ex-assign": "error",
/**
* Disallow unnecessary boolean casts.
*
* (fixable)
*
* https://eslint.org/docs/rules/no-extra-boolean-cast
*/
"no-extra-boolean-cast": "error",
/**
* Disallow unnecessary parentheses.
*
* (fixable)
*
* https://eslint.org/docs/rules/no-extra-parens
*/
"no-extra-parens": ["warn", "all", {
"conditionalAssign": true,
"returnAssign": false,
"nestedBinaryExpressions": false,
"ignoreJSX": "all",
"enforceForArrowConditionals": false,
}],
/**
* Disallow unnecessary semicolons.
*
* (fixable)
*
* https://eslint.org/docs/rules/no-extra-semi
*/
"no-extra-semi": "error",
/**
* Disallow reassigning function declarations.
*
* https://eslint.org/docs/rules/no-func-assign
*/
"no-func-assign": "error",
/**
* Disallow variable or function declarations in nested blocks.
*
* https://eslint.org/docs/rules/no-inner-declarations
*/
"no-inner-declarations": ["error", "both"],
/**
* Disallow invalid regular expression strings in RegExp constructors.
*
* https://eslint.org/docs/rules/no-invalid-regexp
*/
"no-invalid-regexp": ["error", {
"allowConstructorFlags": ["u", "y"],
}],
/**
* Disallow irregular whitespace.
*
* https://eslint.org/docs/rules/no-irregular-whitespace
*/
"no-irregular-whitespace": ["error", {
"skipStrings": false,
"skipComments": false,
"skipRegExps": false,
"skipTemplates": false,
}],
/**
* Disallow characters which are made with multiple code points in character class syntax.
*
* https://eslint.org/docs/rules/no-misleading-character-class
*/
"no-misleading-character-class": "error",
/**
* Disallow calling global object properties as functions.
*
* https://eslint.org/docs/rules/no-obj-calls
*/
"no-obj-calls": "error",
/**
* Disallow calling some Object.prototype methods directly on objects.
*
* https://eslint.org/docs/rules/no-prototype-builtins
*/
"no-prototype-builtins": "error",
/**
* Disallow multiple spaces in regular expressions.
*
* (fixable)
*
* https://eslint.org/docs/rules/no-regex-spaces
*/
"no-regex-spaces": "error",
/**
* Disallow sparse arrays.
*
* https://eslint.org/docs/rules/no-sparse-arrays
*/
"no-sparse-arrays": "error",
/**
* Disallow template literal placeholder syntax in regular strings.
*
* https://eslint.org/docs/rules/no-template-curly-in-string
*/
"no-template-curly-in-string": "error",
/**
* Disallow confusing multiline expressions.
*
* https://eslint.org/docs/rules/no-unexpected-multiline
*/
"no-unexpected-multiline": "error",
/**
* Disallow unreachable code after return, throw, continue, and break statements.
*
* https://eslint.org/docs/rules/no-unreachable
*/
"no-unreachable": "error",
/**
* Disallow control flow statements in finally blocks.
*
* https://eslint.org/docs/rules/no-unsafe-finally
*/
"no-unsafe-finally": "error",
/**
* Disallow negating the left operand of relational operators.
*
* (fixable)
*
* https://eslint.org/docs/rules/no-unsafe-negation
*/
"no-unsafe-negation": "error",
/**
* Disallow assignments that can lead to race conditions due to usage of await or yield.
*
* https://eslint.org/docs/rules/require-atomic-updates
*/
"require-atomic-updates": "error",
/**
* Require calls to isNaN() when checking for NaN.
*
* https://eslint.org/docs/rules/use-isnan
*/
"use-isnan": "error",
/**
* Enforce comparing typeof expressions against valid strings.
*
* https://eslint.org/docs/rules/valid-typeof
*/
"valid-typeof": ["error", {
"requireStringLiterals": true,
}],
}
}