forked from severnway/sevenrules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yml
1236 lines (948 loc) · 23 KB
/
.eslintrc.yml
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
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
root: true
parser: babel-eslint
env:
node: true
es6: true
plugins:
- babel
parserOptions:
ecmaVersion: 2018
sourceType: module
ecmaFeatures:
impliedStrict: true
globalReturn: false
rules:
# Enforces getter/setter pairs in objects
accessor-pairs:
- warn
# Enforce line breaks after opening and before closing array brackets
array-bracket-newline:
- error
- consistent
# - multiline: true
# Handles destructuring arrays with flow type in function parameters
array-bracket-spacing:
- error
- always
- arraysInArrays: false
objectsInArrays: false
# Enforce return statements in callbacks of array’s methods
array-callback-return:
- error
# Enforce line breaks between array elements
array-element-newline:
- off
# 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
# deprecated
babel/array-bracket-spacing:
- off
# deprecated
babel/arrow-parens:
- off
# Require camelcase
babel/camelcase:
- off
# deprecated
babel/flow-object-type:
- off
# deprecated
babel/func-params-comma-dangle:
- off
# deprecated
babel/generator-star-spacing:
- off
# Correct spacing inside objects
babel/object-curly-spacing:
- error
- always
- arraysInObjects: false
objectsInObjects: false
# deprecated
babel/object-shorthand:
- off
# Enforce quote style
babel/quotes:
- error
- double
- avoidEscape: true
allowTemplateLiterals: true
# Require constructor names to begin with a capital letter
babel/new-cap:
- off
# deprecated
babel/no-await-in-loop:
- off
# Disallow invalid this references
babel/no-invalid-this:
- error
# Disallow unused expressions
babel/no-unused-expressions:
- error
# Disallow use of semicolons
babel/semi:
- error
- never
# Ensure string compared to typeof is valid
babel/valid-typeof:
- error
# Treat var as Block Scoped
block-scoped-var:
- off
# Force spacing in single line blocks
block-spacing:
- error
- always
# Force the one true brace style
brace-style:
- error
- 1tbs
# Enforce Return After Callback
callback-return:
- warn
# Do not force camel-case
camelcase:
- off
# Enforce or disallow capitalization of the first letter of a comment
capitalized-comments:
- off
# Enforce that class methods utilize this
class-methods-use-this:
- 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
# Limit Cyclomatic Complexity
complexity:
- warn
# Require or disallow padding inside computed properties
computed-property-spacing:
- error
# Require return statements to either always or never specify values
consistent-return:
- error
# Require Consistent This
consistent-this:
- warn
# Verify calls of super() in constructors
constructor-super:
- error
# Specify curly brace conventions for all control statements
curly:
- error
- all
# Require Default Case in Switch Statements
default-case:
- off
# Enforce consistent newlines before or after dots
dot-location:
- error
- property
# Encourage use of dot notation whenever possible
dot-notation:
- error
# Require a newline at the end of files
eol-last:
- error
- always
# Require use of === and !==
eqeqeq:
- error
# Enforce “for” loop update clause moving the counter in the right direction
for-direction:
- off
# Force consistent spacing when calling functions
func-call-spacing:
- error
- never
# Require function names to match the name of the variable or property to which they are assigned
func-name-matching:
- warn
# Disallow named function expressions
func-names:
- off
# Force expression-style function declarations.
func-style:
- error
- declaration
- allowArrowFunctions: true
# Enforce consistent line breaks inside function parentheses
function-paren-newline:
- error
- consistent
# Force space around generator stars
generator-star-spacing:
- error
- both
# Enforces that a return statement is present in property getters
getter-return:
- warn
# Enforce require() on the top-level module scope
global-require:
- warn
# Require Guarding for-in
guard-for-in:
- off
# Enforce callback error handling
handle-callback-err:
- warn
# Disallow specified identifiers
id-blacklist:
- off
# Enforce minimum and maximum identifier lengths
id-length:
- off
# Require identifiers to match a specified regular expression
id-match:
- off
# Enforce the location of arrow function bodies with implicit returns
implicit-arrow-linebreak:
- error
- beside
# Enforce consistent indentation
indent:
- error
- tab
- SwitchCase: 0
MemberExpression: 1
# Legacy rule
indent-legacy:
- off
# Require or disallow initialization in variable declarations
init-declarations:
- error
- always
# 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
# Enforce position of line comments
line-comment-position:
- warn
- above
# Enforce consistent linebreak style
linebreak-style:
- error
- unix
# Require empty lines around comments
lines-around-comment:
- off
# Require or disallow newlines around directives
lines-around-directive:
- off
# Require or disallow an empty line between class members
lines-between-class-members:
- off
# Enforce a maximum number of classes per file
max-classes-per-file:
- off
# Enforce a maximum depth that blocks can be nested
max-depth:
- warn
- max: 4
# Enforce a maximum line length
max-len:
- off
# Enforce a maximum file length
max-lines:
- off
# Enforce a maximum function length
max-lines-per-function:
- off
# Enforce a maximum depth that callbacks can be nested
max-nested-callbacks:
- warn
- max: 4
# Enforce a maximum number of parameters in function definitions
max-params:
- warn
- max: 5
# Enforce a maximum number of statements allowed per line
max-statements-per-line:
- warn
- max: 1
# Enforce a maximum number of statements allowed in function blocks
max-statements:
- off
# Enforce a particular style for multiline comments
multiline-comment-style:
- error
- separate-lines
# Enforce or disallow newlines between operands of ternary expressions
multiline-ternary:
- off
# Require constructor names to begin with a capital letter
new-cap:
- off # (see babel/new-cap)
# Require parentheses when invoking a constructor with no arguments
new-parens:
- error
# Require or disallow an empty line after variable declaration
newline-after-var:
- off
# Require an empty line before return statements
newline-before-return:
- off
# Require a newline after each call in a method chain
newline-per-chained-call:
- off
# Disallow alert
no-alert:
- error
# Disallow Array constructors
no-array-constructor:
- error
# Disallow using an async function as a Promise executor
no-async-promise-executor:
- error
# Disallow await inside of loops
no-await-in-loop:
- warn
# Disallow bitwise operators
no-bitwise:
- off
# Disallow use of the Buffer() constructor
no-buffer-constructor:
- error
# Disallow Use of caller/callee
no-caller:
- error
# Disallow lexical declarations in case/default clauses
no-case-declarations:
- error
# Disallow shadowing of variables inside of catch
no-catch-shadow:
- error
# Disallow modifying variables of class declarations
no-class-assign:
- error
# disallow comparing against -0
no-compare-neg-zero:
- error
# Disallow assignment operators in conditional statements
no-cond-assign:
- error
# Disallow arrow functions where they could be confused with comparisons
no-confusing-arrow:
- off
# Disallow the use of console
no-console:
- error
# Disallow modifying variables that are declared using const
no-const-assign:
- error
# Disallow constant expressions in conditions
no-constant-condition:
- error
# Disallow continue statements
no-continue:
- off
# Disallow control characters in regular expressions
no-control-regex:
- warn
# Disallow the use of debugger
no-debugger:
- error
# Disallow deleting variables
no-delete-var:
- error
# Disallow regular expressions that look like division
no-div-regex:
- off
# Disallow duplicate arguments in function definitions
no-dupe-args:
- error
# Disallow duplicate name in class members
no-dupe-class-members:
- error
# Disallow duplicate object keys
no-dupe-keys:
- error
# Disallow duplicate case statements
no-duplicate-case:
- error
# Disallow duplicate imports (use the eslint import plugin rule)
no-duplicate-imports:
- off
# Simplify if-else when possible
no-else-return:
- error
# Disallow empty character classes in regular expressions
no-empty-character-class:
- error
# Disallow empty functions
no-empty-function:
- warn
# Disallow empty destructuring patterns
no-empty-pattern:
- error
# Disallow empty block statements
no-empty:
- warn
# Disallow null comparisons
no-eq-null:
- error
# Disallow reassigning exceptions in catch clauses
no-ex-assign:
- error
# Disallow eval
no-eval:
- error
# Disallow extending of native objects
no-extend-native:
- error
# Avoid unnecessary binds
no-extra-bind:
- error
# disallow unnecessary boolean casts
no-extra-boolean-cast:
- error
# Disallow unnecessary labels
no-extra-label:
- error
# Disallow unnecessary parentheses
no-extra-parens:
- error
- all
- ignoreJSX: multi-line
nestedBinaryExpressions: true
# Disallow unnecessary semicolons
no-extra-semi:
- error
# Disallow case statement fallthrough
no-fallthrough:
- error
# Disallow floating decimals
no-floating-decimal:
- error
# Disallow faulty function assignments
no-func-assign:
- error
# Disallow assigning to globals
no-global-assign:
- error
# Disallow the type conversion with shorter notations
no-implicit-coercion:
- error
# Avoid implicit globals
no-implicit-globals:
- error
# Avoid implied eval
no-implied-eval:
- error
# Disallow inline comments after code
no-inline-comments:
- off
# Disallow variable or function declarations in nested blocks
no-inner-declarations:
- warn
# Prevent invalid regexes
no-invalid-regexp:
- error
# Avoid invalid this references
no-invalid-this:
- off # see (babel/no-invalid-this)
# Prevent spacing characters other than space
no-irregular-whitespace:
- error
# Disallow iterator
no-iterator:
- error
# Disallow labels that are variables names
no-label-var:
- error
# Disallow labeled statements
no-labels:
- warn
# Disallow unnecessary nested blocks
no-lone-blocks:
- error
# Avoid lonely ifs in else blocks
no-lonely-if:
- error
# Disallow functions in loops
no-loop-func:
- warn
# Disallow magic numbers
no-magic-numbers:
- off
# Disallow characters which are made with multiple code points in character class syntax
no-misleading-character-class:
- error
# Disallow mixes of different operators
no-mixed-operators:
- off
# Disallow require calls to be mixed with regular variable declarations
no-mixed-requires:
- off
# Disallow mixed spaces and tabs for indentation
no-mixed-spaces-and-tabs:
- off
# Disallow use of chained assignment expressions
no-multi-assign:
- error
# Disallow use of multiple spaces
no-multi-spaces:
- error
# Disallow multiline strings
no-multi-str:
- error
# Disallow multiple empty lines
no-multiple-empty-lines:
- off
# Disallow reassignment of native objects
no-native-reassign:
- error
# Disallow negated conditions
no-negated-condition:
- error
# Prevent !a in b instead of !(a in b) bug
no-negated-in-lhs:
- error
# Disallow nested ternary expressions
no-nested-ternary:
- off
# Disallow function constructor
no-new-func:
- error
# Disallow Object constructors
no-new-object:
- error
# Disallow new require
no-new-require:
- error
# Disallow symbol constructor
no-new-symbol:
- error
# Avoid creating wrappers for String, Boolean, ...
no-new-wrappers:
- error
# Disallow new for side effects
no-new:
- error
# Prevent the accidental calling of global objects as functions
no-obj-calls:
- error
# Disallow octal escape sequences in string literals
no-octal-escape:
- error
# Disallow octal literals
no-octal:
- error
# Disallow reassignment of function parameters
no-param-reassign:
- error
# Disallow string concatenation when using __dirname and __filename
no-path-concat:
- error
# Disallow the unary operators ++ and --
no-plusplus:
- off
# Disallow process.env
no-process-env:
- warn
# Disallow process.exit()
no-process-exit:
- error
# Forbid __proto__
no-proto:
- error
# Disallow calling some Object.prototype methods directly on objects
no-prototype-builtins:
- error
# Disallow variable redeclaration
no-redeclare:
- error
# Disallow multiple spaces in regular expressions
no-regex-spaces:
- error
# Disallow specific global variables
no-restricted-globals:
- off
# Disallow specific imports
no-restricted-imports:
- off
# Disallow Node.js modules
no-restricted-modules:
- off
# Disallow certain object properties
no-restricted-properties:
- off
# Disallow specified syntax
no-restricted-syntax:
- off
# Disallow Assignment in return Statement
no-return-assign:
- error
# Disallows unnecessary return await
no-return-await:
- error
# Disallow script URLs
no-script-url:
- error
# Disallow assignments where both sides are exactly the same
no-self-assign:
- error
# Forbid x === x
no-self-compare:
- error
# Disallow use of the comma operator
no-sequences:
- error
# Disallow shadowing of restricted names
no-shadow-restricted-names:
- error
# Disallow variable declarations from shadowing variables declared in the outer scope
no-shadow:
- warn
# disallow space between function identifier and application
no-spaced-func:
- error
# Disallow [,,]
no-sparse-arrays:
- error
# Disallow synchronous methods
no-sync:
- off
# Disallow all tabs
no-tabs:
- off
# Disallow template literal placeholder syntax in regular strings
no-template-curly-in-string:
- warn
# Disallow ternary operators
no-ternary:
- off
# Disallow use of this/super before calling super() in constructors
no-this-before-super:
- error
# Restrict what can be thrown as an exception
no-throw-literal:
- error
# Disallow trailing whitespace at the end of lines
no-trailing-spaces:
- error
# Disallow initializing to undefined
no-undef-init:
- error
# Disallow undeclared variables
no-undef:
- error
# Disallow use of undefined
no-undefined:
- off
# Disallow dangling underscores in identifiers
no-underscore-dangle:
- off
# Disallow confusing multiline expressions
no-unexpected-multiline:
- error
# Disallow unmodified conditions of loops
no-unmodified-loop-condition:
- error
# Avoid unnecessary ternaries
no-unneeded-ternary:
- error
# Disallow unreachable code
no-unreachable:
- error
# Disallow control flow statements in finally blocks
no-unsafe-finally:
- error
# Disallow unsafe negations
no-unsafe-negation:
- error
# Disallow unused expressions
no-unused-expressions:
- off # (see babel/no-unused-expressions)
# Disallow unused labels
no-unused-labels:
- error
# Forbid unused variables
no-unused-vars:
- error
- args: none
caughtErrors: none
ignoreRestSiblings: true
varsIgnorePattern: ^_$
# Disallow use of variables before they are defined
no-use-before-define:
- warn
- functions: false
variables: false
# Disallow unnecessary .call() and .apply()
no-useless-call:
- error
# Disallow unnecessary catch clauses
no-useless-catch:
- error
# Disallow unnecessary computed property keys on objects
no-useless-computed-key:
- error
# Avoid useless string concatenation
no-useless-concat:
- error
# Disallow unnecessary constructor
no-useless-constructor:
- error
# Disallow unnecessary escape usage
no-useless-escape:
- error
# Disallow renaming import, export, and destructured assignments to the same name
no-useless-rename:
- error
# Disallow redundant return statements
no-useless-return:
- error
# Disallow var
no-var:
- error
# Disallow use of the void operator
no-void:
- off
# Disallow warning comments
no-warning-comments:
- off
# Disallow whitespace before object properties
no-whitespace-before-property:
- error
# Disallow whit blocks
no-with:
- error
# Enforce the location of single-line statements
nonblock-statement-body-position:
- off
# Consistent object newlines
object-curly-newline:
- error
- multiline: true
consistent: true
# Enforce consistent spacing inside braces (uses babel plugin rule)
object-curly-spacing:
- off
# Enforce placing object properties on separate lines
object-property-newline:
- error
- allowAllPropertiesOnSameLine: true
# doesn't fail when using object spread (...obj)
object-shorthand:
- error
# Force var declarations to only have one var
one-var:
- error
- never
# Allow only one declaration per line
one-var-declaration-per-line:
- error