-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.json
444 lines (444 loc) · 12 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
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
{
"env": {
"browser": true,
"node": true,
"es6": true,
"mocha": true
},
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true
}
},
"globals": {},
"rules": {
/* Possible Errors */
// disallow assignment operators in conditional expressions
"no-cond-assign": 2,
// disallow the use of console
"no-console": 1,
// disallow constant expressions in conditions
"no-constant-condition": 2,
// disallow the use of debugger
"no-debugger": 2,
// disallow duplicate arguments in function definitions
"no-dupe-args": 2,
// disallow duplicate keys in object literals
"no-dupe-keys": 2,
// disallow duplicate case labels
"no-duplicate-case": 2,
// disallow empty character classes in regular expressions
"no-empty-character-class": 2,
// disallow empty block statements
"no-empty": [
1,
{
"allowEmptyCatch": true
}
],
// disallow reassigning exceptions in catch clauses
"no-ex-assign": 2,
// disallow unnecessary boolean casts
"no-extra-boolean-cast": 2,
// disallow unnecessary parentheses
"no-extra-parens": 2,
// disallow unnecessary semicolons
"no-extra-semi": 2,
// disallow reassigning function declarations
"no-func-assign": 2,
// disallow function or var declarations in nested blocks
"no-inner-declarations": [
2,
"both"
],
// disallow invalid regular expression strings in RegExp constructors
"no-invalid-regexp": 2,
// disallow irregular whitespace outside of strings and comments
"no-irregular-whitespace": [
2,
{
"skipStrings": true,
"skipComments": true,
"skipRegExps": true,
"skipTemplates": true
}
],
// disallow negating the left operand in in expressions
"no-negated-in-lhs": 2,
// disallow calling global object properties as functions
"no-obj-calls": 2,
// disallow use of Object.prototypes builtins directly
"no-prototype-builtins": 2,
//disallow multiple spaces in regular expression literals
"no-regex-spaces": 2,
// disallow sparse arrays
"no-sparse-arrays": 1,
// disallow confusing multiline expressions
"no-unexpected-multiline": 1,
// disallow unreachable code after return, throw, continue, and break statements
"no-unreachable": 2,
// disallow control flow statements in finally blocks
"no-unsafe-finally": 1,
// require calls to isNaN() when checking for NaN
"use-isnan": 2,
// enforce valid JSDoc comments
"valid-jsdoc": 1,
// enforce comparing typeof expressions against valid strings
"valid-typeof": 2,
/* Best Practices */
// Enforces getter/setter pairs in objects
"accessor-pairs": 1,
// Enforces return statements in callbacks of array’s methods
"array-callback-return": 1,
// enforce the use of variables within the scope they are defined
"block-scoped-var": 1,
// enforce consistent brace style for all control statements
"curly": 1,
// require default cases in switch statements
"default-case": 1,
// enforce consistent newlines before and after dots
"dot-notation": 1,
// require the use of === and !==
"eqeqeq": [
2,
"allow-null"
],
// require for-in loops to include an if statement
"guard-for-in": 1,
// disallow the use of alert, confirm, and prompt
"no-alert": 1,
// disallow the use of arguments.caller or arguments.callee
"no-caller": 2,
// disallow the use of eval()
"no-eval": 2,
// disallow extending native types
"no-extend-native": 1,
// disallow unnecessary calls to .bind()
"no-extra-bind": 1,
// disallow leading or trailing decimal points in numeric literals
"no-floating-decimal": 2,
// disallow var and named function declarations in the global scope
"no-implicit-globals": 1,
// disallow the use of eval()-like methods
"no-implied-eval": 2,
// disallow unnecessary nested blocks
"no-lone-blocks": 1,
// disallow function declarations and expressions inside loop statements
"no-loop-func": 1,
// disallow multiple spaces
"no-multi-spaces": 1,
// disallow var redeclaration
"no-redeclare": [
2,
{
"builtinGlobals": true
}
],
// disallow comma operators
"no-sequences": 1,
// require var declarations be placed at the top of their containing scope
"vars-on-top": 1,
// require parentheses around immediate function invocations
"wrap-iife": 1,
// require or disallow “Yoda” conditions
"yoda": 1,
/* Strict Mode */
"strict": [
1,
"function"
],
/* Variables */
// disallow deleting variables
"no-delete-var": 2,
// disallow specified global variables
"no-restricted-globals": 2,
// disallow unused variables
"no-unused-vars": 1,
// disallow the use of variables before they are defined
"no-use-before-define": 2,
// Disallow Use of undefined Variable
"no-undef": 2,
// disallow initializing variables to undefined
"no-undef-init": 1,
// disallow the use of undefined as an identifier
"no-undefined": 1,
// disallow var declarations from shadowing variables in the outer scope
"no-shadow": [
2,
{
"hoist": "functions"
}
],
/* Stylistic Issues */
// enforce consistent spacing inside array brackets
"array-bracket-spacing": [
1,
"never"
],
// enforce consistent spacing inside single-line blocks
"block-spacing": [
1,
"never"
],
// enforce consistent brace style for blocks
"brace-style": [
1,
"1tbs",
{
"allowSingleLine": true
}
],
// require or disallow trailing commas,
"comma-dangle": 1,
// enforce consistent spacing before and after commas
"comma-spacing": [
1,
{
"before": false,
"after": true
}
],
// enforce consistent comma style
"comma-style": [
1,
"last"
],
// enforce consistent spacing inside computed property brackets
"computed-property-spacing": [
1,
"never"
],
// enforce consistent naming when capturing the current execution context
"consistent-this": [
1,
"that"
],
// enforce at least one newline at the end of files
"eol-last": 1,
// disallow specified identifiers
"id-blacklist": 1,
// enforce consistent indentation
"indent": [
1,
2,
{
"SwitchCase": 1
}
],
// enforce consistent spacing between keys and values in object literal properties
"key-spacing": [
1,
{
"afterColon": true
}
],
// enforce consistent spacing before and after keywords
"keyword-spacing": 1,
// enforce a maximum line length
"max-len": [
1,
100,
2,
{
"ignoreComments": true,
"ignoreTrailingComments": true,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
// enforce a maximum number of parameters in function definitions
"max-params": [
1,
3
],
// require constructor function names to begin with a capital letter
"new-cap": 1,
// require parentheses when invoking a constructor with no arguments
"new-parens": 1,
// disallow mixed spaces and tabs for indentation
"no-mixed-spaces-and-tabs": 1,
// disallow multiple empty lines
"no-multiple-empty-lines": [
1,
{
"max": 1,
"maxBOF": 0,
"maxEOF": 1
}
],
// disallow spacing between function identifiers and their applications
"no-spaced-func": 1,
// disallow trailing whitespace at the end of lines
"no-trailing-spaces": 1,
// disallow ternary operators when simpler alternatives exist
"no-unneeded-ternary": 1,
// disallow whitespace before properties
"no-whitespace-before-property": 1,
// enforce consistent spacing inside braces
"object-curly-spacing": [
0
],
// enforce the consistent use of either backticks, double, or single quotes
"quotes": [
1,
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
// enforce consistent spacing before and after semicolons
"semi-spacing": [
1,
{
"before": false,
"after": true
}
],
// require or disallow semicolons instead of ASI
"semi": 1,
// enforce consistent spacing before blocks
"space-before-blocks": 1,
// enforce consistent spacing before function definition opening parenthesis
"space-before-function-paren": [
1,
{
"anonymous": "always",
"named": "never"
}
],
// enforce consistent spacing inside parentheses
"space-in-parens": [
1,
"never"
],
// require spacing around operators
"space-infix-ops": 1,
// enforce consistent spacing after the // or /* in a comment
"spaced-comment": [
1,
"always"
],
/* ECMAScript 6 */
// require braces around arrow function bodies
"arrow-body-style": [
1,
"as-needed"
],
// require parentheses around arrow function arguments
"arrow-parens": [
1,
"as-needed"
],
// enforce consistent spacing before and after the arrow in arrow functions
"arrow-spacing": [
1,
{
"before": true,
"after": true
}
],
// require super() calls in constructors
"constructor-super": 2,
// enforce consistent spacing around * operators in generator functions
"generator-star-spacing": [
1,
{
"before": true,
"after": false
}
],
// disallow reassigning class members
"no-class-assign": 2,
// disallow arrow functions where they could be confused with comparisons
"no-confusing-arrow": 0,
// disallow reassigning const variables
"no-const-assign": 2,
// disallow duplicate class members
"no-dupe-class-members": 1,
// disallow duplicate module imports
"no-duplicate-imports": [
1,
{
"includeExports": true
}
],
// disallow new operators with the Symbol object
"no-new-symbol": 2,
// disallow specified modules when loaded by import
"no-restricted-imports": [
2,
"assert",
"buffer",
"child_process",
"cluster",
"crypto",
"dgram",
"dns",
"domain",
"events",
"freelist",
"fs",
"http",
"https",
"module",
"net",
"os",
"path",
"punycode",
"querystring",
"readline",
"repl",
"smalloc",
"stream",
"string_decoder",
"sys",
"timers",
"tls",
"tracing",
"tty",
"url",
"util",
"vm",
"zlib"
],
// disallow this/super before calling super() in constructors
"no-this-before-super": 2,
// disallow unnecessary computed property keys in object literals
"no-useless-computed-key": 1,
// disallow unnecessary constructors
"no-useless-constructor": 1,
// disallow renaming import, export, and destructured assignments to the same name
"no-useless-rename": 1,
// require let or const instead of var
"no-var": 1,
// require rest parameters instead of arguments
"prefer-rest-params": 1,
// require template literals instead of string concatenation
"prefer-template": 1,
// require generator functions to contain yield
"require-yield": 2,
// enforce spacing between rest and spread operators and their expressions
"rest-spread-spacing": [
1,
"never"
],
// require or disallow spacing around embedded expressions of template strings
"template-curly-spacing": [
1,
"never"
],
// require or disallow spacing around the * in yield* expressions
"yield-star-spacing": [
1,
{
"before": true,
"after": false
}
]
}
}