-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslintrc.yaml
639 lines (485 loc) · 11.8 KB
/
eslintrc.yaml
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
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
# use babel parser (requires babel-eslint)
parser: babel-eslint
env:
# browser global variables
browser: true
# enable all ECMAScript 6 features (except for modules)
es6: true
globals:
__DEV__: false
__CLIENT__: false
__DEVTOOLS__: false
module: false
# enable plugins
plugins:
- react
- babel
- import
- react-hooks
settings:
import/resolver:
eslint-config-ttn/resolver:
alias:
"~": src
react:
version: detect
# enable all language features
parserOptions:
ecmaFeatures:
# enable arrow functions
arrowFunctions: true
# enable binary literals
binaryLiterals: true
# enable let and const (aka block bindings)
blockBindings: true
# enable classes
classes: true
# enable default function parameters
defaultParams: true
# enable destructuring
destructuring: true
# enable for-of loops
forOf: true
# enable generators
generators: true
# enable modules and global strict mode
modules: true
# enable computed object literal property names
objectLiteralComputedProperties: true
# enable duplicate object literal properties in strict mode
objectLiteralDuplicateProperties: true
# enable object literal shorthand methods
objectLiteralShorthandMethods: true
# enable object literal shorthand properties
objectLiteralShorthandProperties: true
# enable octal literals
octalLiterals: true
# enable the regular expression u flag
regexUFlag: true
# enable the regular expression y flag
regexYFlag: true
# enable the rest parameters
restParams: true
# enable the spread operator
spread: true
# enable super references inside of functions
superInFunctions: true
# enable template strings
templateStrings: true
# enable code point escapes
unicodeCodePointEscapes: true
# allow return statements in the global scope
globalReturn: true
# enable JSX
jsx: true
# configure rules
rules:
# Handles destructuring arrays with flow type in function parameters
array-bracket-spacing:
- off
# Enforce return statements in callbacks of array’s methods
array-callback-return:
- error
# Consistent arrow bodies
arrow-body-style:
- error
- never
# Force parentheses only when needed in arrow functions
arrow-parens:
- error
- as-needed
# Force arrow bodies to be simple
arrow-spacing:
- error
# Correct spacing inside objects
babel/object-curly-spacing:
- off
# Guard against awaiting async functions inside of a loop
no-await-in-loop:
- warn
# Force spacing in single line blocks
block-spacing:
- error
- always
# Force the one true brace style
brace-style:
- error
- 1tbs
# Do not force camel-case
camelcase:
- off
# Force dangling commas
comma-dangle:
- error
- always-multiline
# Enforce spacing and after comma
comma-spacing:
- error
# Enforce one true comma style
comma-style:
- error
- last
# Require or disallow padding inside computed properties
computed-property-spacing:
- error
# Specify curly brace conventions for all control statements
curly:
- error
- all
# Enforce consistent newlines before or after dots
dot-location:
- error
- property
# Encourage use of dot notation whenever possible
dot-notation:
- error
# Require use of === and !==
eqeqeq:
- error
# Force consistent spacing when calling functions
func-call-spacing:
- error
- never
# Force space around generator stars
generator-star-spacing:
- error
- both
# Consisten indentation
indent:
- error
- 2
- SwitchCase: 0
MemberExpression: 1
# Make sure default is present when required
import/default:
- error
# Put all imports first
import/first:
- error
# Report invalid exports
import/export:
- error
# Avoid amd-style import/export
import/no-amd:
- error
# Make sure names exist
import/named:
- error
# Make sure deferenced items of a namespace import exist
import/namespace:
- error
# Avoid commonjs style import/export
import/no-commonjs:
- error
# Avoid duplicate imports of the same module
import/no-duplicates:
- error
# Avoid unresolvable imports
import/no-unresolved:
- error
# Warn about import order
import/order:
- warn
# Avoid/force extensions
import/extensions:
- error
- always
- js: never
# Prefer defaul export for single export
import/prefer-default-export:
- warn
# Use double quotes in jsx
jsx-quotes:
- error
- prefer-double
# Consistent object key spacing
key-spacing:
- error
- beforeColon: false
afterColon: true
mode: strict
# Enforce spacing before and after keywords
keyword-spacing:
- error
# Disallow alert
no-alert:
- error
# Disallow if (true) and if (false)
no-constant-condition:
- error
# Disallow duplicate fn arguments
no-dupe-args:
- error
# Disallow duplicate object keys
no-dupe-keys:
- error
# Disallow duplicate case statements
no-duplicate-case:
- error
# Prevent duplicate imports
no-duplicate-imports:
- error
# Simplify if-else when possible
no-else-return:
- error
# Disallow eval
no-eval:
- error
# Avoid unnecessary binds
no-extra-bind:
- error
# Disallow faulty function assignments
no-func-assign:
- error
# Disallow assigning to globals
no-global-assign:
- error
# Avoid implied eval
no-implied-eval:
- error
# Avoid implicit globals
no-implicit-globals:
- error
# Disallow decalring functions inside nested block
no-inner-declarations:
- warn
# Prevent invalid regexes
no-invalid-regexp:
- error
# Avoid invalid this references
no-invalid-this:
- error
# Prevent spacing characters other than space
no-irregular-whitespace:
- error
# Avoid lonely ifs in else blocks
no-lonely-if:
- error
# Prevent !a in b instead of !(a in b) bug
no-negated-in-lhs:
- error
# Avoid creating wrappers for String, Boolean, ...
no-new-wrappers:
- error
# Disallow mixed spaces and tabs for indentation
no-mixed-spaces-and-tabs:
- error
# Disallow use of multiple spaces
no-multi-spaces:
- error
# Prevent the accidental calling of global objects as functions
no-obj-calls:
- error
# Disallow reassignment of function parameters
no-param-reassign:
- error
# Forbid __proto__
no-proto:
- error
# Forbid x === x
no-self-compare:
- error
# Disallow assignments where both sides are exactly the same
no-self-assign:
- error
# disallow space between function identifier and application
no-spaced-func:
- error
# Disallow [,,]
no-sparse-arrays:
- error
# disallow trailing whitespace at the end of lines
no-trailing-spaces:
- error
# Avoid unnecessary ternaries
no-unneeded-ternary:
- error
# Disallow unreachable code
no-unreachable:
- error
# Disallow unsafe negations
no-unsafe-negation:
- error
no-unused-expressions:
- error
# Disallow unused variables
no-unused-vars:
- error
- args: none
caughtErrors: none
ignoreRestSiblings: true
no-useless-call:
- error
no-useless-computed-key:
- error
no-useless-constructor:
- error
no-useless-escape:
- error
no-useless-rename:
- error
# Disallow use of undefined
no-undefined:
- off
# Disallow use of undefined variables
no-undef:
- error
# Disallow use of variables before they are defined
no-use-before-define:
- warn
- functions: false
variables: false
# Disallow var
no-var:
- error
# Disallow whit blocks
no-with:
- error
# Disallow whitespace before object properties
no-whitespace-before-property:
- error
# Consistent object newlines
object-curly-newline:
- error
- multiline: true
consistent: true
# doesn't fail when using object spread (...obj)
object-shorthand:
- error
# Allow only one declaration per line
one-var-declaration-per-line:
- error
# Force operator shorthands when possible
operator-assignment:
- error
- always
# Enforce operators to be placed before or after line breaks
operator-linebreak:
- error
- before
- overrides:
=: after
# Suggest using const declaration for variables that are never reassigned after declared
prefer-const:
- warn
# Suggest using the rest parameters instead of arguments
prefer-rest-params:
- error
# Suggest using the spread operator instead of .apply()
prefer-spread:
- error
# Prefer template strings instead of concatenation
prefer-template:
- warn
# Avoid useless string concatenation
no-useless-concat:
- error
# Require quotes around object literal property names
quote-props:
- error
- as-needed
- keywords: true
# Specify whether backticks, double or single quotes should be used
quotes:
- error
- single
- avoidEscape: true
allowTemplateLiterals: true
# Prevent usage of deprecated methods
react/no-deprecated:
- error
# Prevent direct mutation of this.state
react/no-direct-mutation-state:
- error
# Prevent usage of unknown DOM property (fixable)
react/no-unknown-property:
- error
# Enforce ES5 or ES6 class for React Components
react/prefer-es6-class:
- error
# Prevent missing React when using JSX
react/react-in-jsx-scope:
- error
# Prevent extra closing tags for components without children
react/self-closing-comp:
- warn
# Prevent missing parentheses around multilines JSX (fixable)
react/jsx-wrap-multilines:
- error
# Enforce boolean attributes notation in JSX (fixable)
react/jsx-boolean-value:
- error
# Validate closing bracket location in JSX (fixable)
react/jsx-closing-bracket-location:
- error
# Enforce or disallow spaces inside of curly braces in JSX attributes (fixable)
react/jsx-curly-spacing:
- error
# Validate props indentation in JSX (fixable)
react/jsx-indent-props:
- error
- 2
# Validate JSX indentation
react/jsx-indent:
- error
- 2
# Validate JSX has key prop when in array or iterator
react/jsx-key:
- error
# Prevent usage of .bind() and arrow functions in JSX props
react/jsx-no-bind:
- warn
# Prevent duplicate props in JSX
react/jsx-no-duplicate-props:
- error
# Make react spacing consistent
react/jsx-tag-spacing:
- error
- closingSlash: never
beforeSelfClosing: always
afterOpening: never
# Prevent React to be incorrectly marked as unused
react/jsx-uses-react: 1
# Prevent variables used in JSX to be incorrectly marked as unused
react/jsx-uses-vars: 1
# Consistent spacing of the rest operator
rest-spread-spacing:
- error
- never
# Require or disallow use of semicolons instead of ASI
semi:
- error
- never
# Require or disallow a space before blocks
space-before-blocks:
- error
# Require or disallow a space before function opening parenthesis
space-before-function-paren:
- error
space-infix-ops:
- error
space-unary-ops:
- error
- nonwords: false
words: true
# Require or disallow a space immediately following the // or /* in a comment
spaced-comment:
- error
# Consistent spacing in template string
template-curly-spacing:
- error
# Never compare to NaN
use-isnan:
- error
# Ensure string compared to typeof is valid
valid-typeof:
- error
# enforce spacing around the * in yield* expressions
yield-star-spacing:
- error
- both
# checks rules of hooks
react-hooks/rules-of-hooks: error
# checks effect dependencies
react-hooks/exhaustive-deps: warn
# vim: ft=yaml