-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.base.js
913 lines (882 loc) · 68 KB
/
.eslintrc.base.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
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
/* cspell: disable */
const lintLevel = parseInt(process.env.LINT_LEVEL ?? '0', 10);
const usingTypechecking = lintLevel >= 0;
const TYPESCRIPT = 'off';
const COMPILER = 'off';
const RECOMMENDED = severity => severity;
const TC = severity => (usingTypechecking ? severity : 'off');
const OVERRIDE = (use, _old) => use;
const REDUNDANT = () => 'off';
module.exports = (tsconfigPath) => ({
'root': true,
'parser': '@typescript-eslint/parser',
'parserOptions': {
...(usingTypechecking ? { 'project': [ tsconfigPath ]} : null),
'sourceType': 'module',
'impliedStrict': true,
},
// Other plugins to consider:
// eslint-plugin-jsonc - scan json files
'plugins': [
'@typescript-eslint',
'eslint-comments',
'no-secrets',
'security',
'react',
'eslint-plugin-react-hooks',
'jsx-a11y',
'eslint-plugin-tsdoc',
'sonarjs',
'promise',
'node',
'unicorn',
'import',
],
'extends': [
],
'settings': {
'react': {
'version': 'detect',
},
},
'env': {
'browser': true,
'amd': true,
'node': true,
},
'rules': {
/* Possible Errors */
'for-direction': RECOMMENDED('error'),
'getter-return': COMPILER,
'no-async-promise-executor': RECOMMENDED('error'),
'no-await-in-loop': 'off',
'no-compare-neg-zero': RECOMMENDED('error'),
'no-cond-assign': RECOMMENDED('error'),
'no-console': 'warn',
'no-constant-condition': RECOMMENDED('error'),
'no-control-regex': RECOMMENDED('error'),
'no-debugger': RECOMMENDED('error'),
'no-dupe-args': COMPILER,
'no-dupe-else-if': RECOMMENDED('error'),
'no-dupe-keys': RECOMMENDED('error'),
'no-duplicate-case': RECOMMENDED('error'),
'no-empty': RECOMMENDED('error'),
'no-empty-character-class': RECOMMENDED('error'),
'no-ex-assign': RECOMMENDED('error'),
'no-extra-boolean-cast': RECOMMENDED('error'),
'no-extra-parens': TYPESCRIPT,
'no-extra-semi': TYPESCRIPT,
'no-func-assign': COMPILER,
'no-import-assign': COMPILER,
'no-inner-declarations': OVERRIDE('off', RECOMMENDED('error')),
'no-invalid-regexp': RECOMMENDED('error'),
'no-irregular-whitespace': RECOMMENDED('error'),
'no-loss-of-precision': TYPESCRIPT,
'no-misleading-character-class': RECOMMENDED('error'),
'no-obj-calls': COMPILER,
'no-promise-executor-return': 'error',
'no-prototype-builtins': RECOMMENDED('error'),
'no-regex-spaces': RECOMMENDED('error'),
'no-setter-return': COMPILER,
'no-sparse-arrays': RECOMMENDED('error'),
'no-template-curly-in-string': 'error',
'no-unexpected-multiline': RECOMMENDED('error'),
'no-unreachable': COMPILER,
'no-unreachable-loop': 'error',
'no-unsafe-finally': RECOMMENDED('error'),
'no-unsafe-negation': COMPILER,
'no-unsafe-optional-chaining': 'error',
'no-useless-backreference': 'error',
'require-atomic-updates': 'error',
'use-isnan': RECOMMENDED('error'),
'valid-typeof': COMPILER,
/* Best Practices */
'accessor-pairs': 'error',
'array-callback-return': 'error',
'block-scoped-var': 'error',
'class-methods-use-this': 'off',
'complexity': 'off',
'consistent-return': 'off',
'curly': [ 'warn', 'multi-or-nest', 'consistent' ],
'default-case': 'off',
'default-case-last': 'error',
'default-param-last': TYPESCRIPT,
'dot-location': [ 'warn', 'property' ],
'dot-notation': TYPESCRIPT,
'eqeqeq': [ 'warn', 'smart' ],
'grouped-accessor-pairs': 'error',
'guard-for-in': 'off',
'max-classes-per-file': 'off',
'no-alert': 'error',
'no-caller': 'error',
'no-case-declarations': RECOMMENDED('error'),
'no-constructor-return': 'error',
'no-div-regex': 'warn',
'no-else-return': 'warn',
'no-empty-function': TYPESCRIPT,
'no-empty-pattern': RECOMMENDED('error'),
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'warn',
'no-extra-label': 'warn',
'no-fallthrough': RECOMMENDED('error'),
'no-floating-decimal': 'warn',
'no-global-assign': RECOMMENDED('error'),
'no-implicit-coercion': 'off',
'no-implicit-globals': 'error',
'no-implied-eval': TYPESCRIPT,
'no-invalid-this': TYPESCRIPT,
'no-iterator': 'error',
'no-labels': 'off',
'no-lone-blocks': 'error',
'no-loop-func': TYPESCRIPT,
'no-magic-numbers': TYPESCRIPT,
'no-multi-spaces': 'off',
'no-multi-str': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-nonoctal-decimal-escape': 'error',
'no-octal': RECOMMENDED('error'),
'no-octal-escape': 'error',
'no-param-reassign': 'off',
'no-proto': 'error',
'no-redeclare': TYPESCRIPT,
'no-restricted-properties': 'off',
'no-return-assign': 'error',
'no-return-await': TYPESCRIPT,
'no-script-url': 'error',
'no-self-assign': RECOMMENDED('error'),
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': TYPESCRIPT,
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': TYPESCRIPT,
'no-unused-labels': OVERRIDE('warn', RECOMMENDED('error')),
'no-useless-call': 'error',
'no-useless-catch': RECOMMENDED('error'),
'no-useless-concat': 'error',
'no-useless-escape': RECOMMENDED('error'),
'no-useless-return': 'warn',
'no-void': 'off',
'no-warning-comments': 'off',
'no-with': RECOMMENDED('error'),
'prefer-named-capture-group': 'off',
'prefer-promise-reject-errors': 'error',
'prefer-regex-literals': 'error',
'radix': 'off',
'require-await': TYPESCRIPT,
'require-unicode-regexp': 'warn',
'vars-on-top': 'off',
'wrap-iife': 'warn',
'yoda': 'warn',
// Strict Mode
'strict': [ 'warn', 'never' ],
// Variables
'init-declarations': TYPESCRIPT,
'no-delete-var': RECOMMENDED('error'),
'no-label-var': 'error',
'no-restricted-globals': [ 'error', 'event', 'name' ],
'no-shadow': TYPESCRIPT,
'no-shadow-restricted-names': RECOMMENDED('error'),
'no-undef': COMPILER,
'no-undef-init': 'off',
'no-undefined': 'off',
'no-unused-vars': TYPESCRIPT,
'no-use-before-define': TYPESCRIPT,
// Stylistic Issues
'array-bracket-newline': [ 'warn', 'consistent' ],
'array-bracket-spacing': [
'warn',
'always',
{ singleValue: true, objectsInArrays: false, arraysInArrays: false },
],
'array-element-newline': [ 'warn', 'consistent' ],
'block-spacing': [ 'warn', 'always' ],
'brace-style': TYPESCRIPT,
'camelcase': 'off',
'capitalized-comments': 'off',
'comma-dangle': TYPESCRIPT,
'comma-spacing': TYPESCRIPT,
'comma-style': [ 'warn', 'last' ],
'computed-property-spacing': [ 'warn', 'never' ],
'consistent-this': [ 'error', 'self' ],
'eol-last': [ 'warn', 'always' ],
'func-call-spacing': TYPESCRIPT,
'func-name-matching': [ 'error', 'always' ],
'func-names': [ 'error', 'as-needed' ],
'func-style': [ 'error', 'declaration', { allowArrowFunctions: true }],
'function-call-argument-newline': [ 'warn', 'consistent' ],
'function-paren-newline': [ 'warn', 'consistent' ],
'id-denylist': 'off',
'id-length': 'off',
'id-match': 'off',
'implicit-arrow-linebreak': 'off',
'indent': TYPESCRIPT,
'jsx-quotes': [ 'warn', 'prefer-double' ],
'key-spacing': [ 'warn', { beforeColon: false, afterColon: true, mode: 'minimum' }],
'keyword-spacing': TYPESCRIPT,
'line-comment-position': 'off',
'linebreak-style': [ 'warn', 'unix' ],
'lines-around-comment': 'off',
'lines-between-class-members': TYPESCRIPT,
'max-depth': 'off',
'max-len': [ 'error', 240 ],
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-nested-callbacks': 'off',
'max-params': 'off',
'max-statements': 'off',
'max-statements-per-line': 'off',
'multiline-comment-style': 'off',
'multiline-ternary': 'off',
'new-cap': [ 'error', { newIsCap: true, capIsNew: false }],
'new-parens': [ 'warn', 'always' ],
'newline-per-chained-call': 'off',
'no-array-constructor': TYPESCRIPT,
'no-bitwise': 'off',
'no-continue': 'off',
'no-inline-comments': 'off',
'no-lonely-if': 'warn',
'no-mixed-operators': 'off',
'no-mixed-spaces-and-tabs': RECOMMENDED('error'),
'no-multi-assign': 'off',
'no-multiple-empty-lines': [ 'warn', { 'max': 1, 'maxBOF': 0, 'maxEOF': 0 }],
'no-negated-condition': 'off',
'no-nested-ternary': 'off',
'no-new-object': 'error',
'no-plusplus': 'off',
'no-restricted-syntax': 'off',
'no-tabs': 'warn',
'no-ternary': 'off',
'no-trailing-spaces': 'warn',
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'warn',
'no-whitespace-before-property': 'warn',
'nonblock-statement-body-position': 'off',
'object-curly-newline': [ 'warn', { consistent: true }],
'object-curly-spacing': TYPESCRIPT,
'object-property-newline': [ 'warn', { allowAllPropertiesOnSameLine: true }],
'one-var': 'off',
'one-var-declaration-per-line': [ 'warn', 'always' ],
'operator-assignment': 'off',
'operator-linebreak': [ 'warn', 'after', { overrides: { '?': 'before', ':': 'before' }}],
'padded-blocks': [ 'warn', 'never' ],
'padding-line-between-statements': 'off',
'prefer-exponentiation-operator': 'off',
'prefer-object-spread': 'warn',
'quote-props': 'off',
'quotes': TYPESCRIPT,
'semi': TYPESCRIPT,
'semi-spacing': [ 'warn', { before: false, after: true }],
'semi-style': [ 'warn', 'last' ],
'sort-keys': 'off',
'sort-vars': 'off',
'space-before-blocks': [ 'warn', 'always' ],
'space-before-function-paren': TYPESCRIPT,
'space-in-parens': [ 'warn', 'never' ],
'space-infix-ops': TYPESCRIPT,
'space-unary-ops': [ 'warn', { words: true, nonwords: false, overrides: { 'typeof': false }}],
'spaced-comment': 'off',
'switch-colon-spacing': [ 'warn', { before: false, after: true }],
'template-tag-spacing': [ 'warn', 'never' ],
'unicode-bom': 'off',
'wrap-regex': 'off',
// ECMAScript 6
'arrow-body-style': 'off',
'arrow-parens': [ 'warn', 'as-needed' ],
'arrow-spacing': [ 'warn', { before: true, after: true }],
'constructor-super': COMPILER,
'generator-star-spacing': [ 'warn', { before: true, after: false }],
'no-class-assign': RECOMMENDED('error'),
'no-confusing-arrow': [ 'warn', { allowParens: true }],
'no-const-assign': COMPILER,
'no-dupe-class-members': TYPESCRIPT,
'no-duplicate-imports': TYPESCRIPT,
'no-new-symbol': COMPILER,
'no-restricted-exports': 'off',
'no-restricted-imports': 'off',
'no-this-before-super': COMPILER,
'no-useless-computed-key': 'warn',
'no-useless-constructor': TYPESCRIPT,
'no-useless-rename': 'warn',
'no-var': COMPILER,
'object-shorthand': 'off',
'prefer-arrow-callback': 'warn',
'prefer-const': COMPILER,
'prefer-destructuring': [ 'off', { array: true, object: true }],
'prefer-numeric-literals': 'warn',
'prefer-rest-params': RECOMMENDED('error'),
'prefer-spread': RECOMMENDED('error'),
'prefer-template': 'warn',
'require-yield': RECOMMENDED('error'),
'rest-spread-spacing': [ 'warn', 'never' ],
'sort-imports': 'off',
'symbol-description': 'off',
'template-curly-spacing': [ 'warn', 'never' ],
'yield-star-spacing': [ 'warn', { before: true, after: false }],
// Supported Rules
'@typescript-eslint/adjacent-overload-signatures': RECOMMENDED('error'),
'@typescript-eslint/array-type': [ 'warn', { default: 'array' }],
'@typescript-eslint/await-thenable': TC(RECOMMENDED('error')),
'@typescript-eslint/ban-ts-comment': RECOMMENDED('error'),
'@typescript-eslint/ban-tslint-comment': 'error',
'@typescript-eslint/ban-types': OVERRIDE('off', RECOMMENDED('error')),
'@typescript-eslint/class-literal-property-style': [ 'warn', 'fields' ],
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/consistent-type-assertions': [ 'error', { 'assertionStyle': 'as' }],
'@typescript-eslint/consistent-type-definitions': [ 'warn', 'type' ],
'@typescript-eslint/consistent-type-imports': [ 'warn', { 'prefer': 'type-imports' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': [ 'warn', { accessibility: 'explicit', overrides: { constructors: 'no-public' }}],
'@typescript-eslint/explicit-module-boundary-types': [ RECOMMENDED('warn'), { allowArgumentsExplicitlyTypedAsAny: true } ],
'@typescript-eslint/member-delimiter-style': 'warn',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/method-signature-style': [ 'error', 'property' ],
'@typescript-eslint/naming-convention': TC('off'),
'@typescript-eslint/no-base-to-string': TC('off'),
'@typescript-eslint/no-confusing-non-null-assertion': 'warn',
'@typescript-eslint/no-confusing-void-expression': TC('warn'),
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-empty-interface': RECOMMENDED('error'),
'@typescript-eslint/no-explicit-any': OVERRIDE('off', RECOMMENDED('warn')),
'@typescript-eslint/no-extra-non-null-assertion': RECOMMENDED('error'),
'@typescript-eslint/no-extraneous-class': 'warn',
'@typescript-eslint/no-floating-promises': TC(RECOMMENDED('error')),
'@typescript-eslint/no-for-in-array': TC(RECOMMENDED('error')),
'@typescript-eslint/no-implicit-any-catch': 'warn',
'@typescript-eslint/no-inferrable-types': OVERRIDE('warn', RECOMMENDED('error')),
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-misused-new': RECOMMENDED('error'),
'@typescript-eslint/no-misused-promises': TC(RECOMMENDED('error')),
'@typescript-eslint/no-namespace': OVERRIDE('off', RECOMMENDED('error')),
'@typescript-eslint/no-non-null-asserted-optional-chain': RECOMMENDED('error'),
'@typescript-eslint/no-non-null-assertion': OVERRIDE('off', RECOMMENDED('warn')),
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-this-alias': RECOMMENDED('error'),
'@typescript-eslint/no-type-alias': 'off',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': TC('warn'),
'@typescript-eslint/no-unnecessary-condition': TC('off'),
'@typescript-eslint/no-unnecessary-qualifier': TC('warn'),
'@typescript-eslint/no-unnecessary-type-arguments': TC('warn'),
'@typescript-eslint/no-unnecessary-type-assertion': TC(RECOMMENDED('error')),
'@typescript-eslint/no-unnecessary-type-constraint': 'warn',
'@typescript-eslint/no-unsafe-assignment': TC(OVERRIDE('off', RECOMMENDED('error'))),
'@typescript-eslint/no-unsafe-call': TC(OVERRIDE('off', RECOMMENDED('error'))),
'@typescript-eslint/no-unsafe-member-access': TC(OVERRIDE('off', RECOMMENDED('error'))),
'@typescript-eslint/no-unsafe-return': TC(OVERRIDE('off', RECOMMENDED('error'))),
'@typescript-eslint/no-var-requires': RECOMMENDED('error'),
'@typescript-eslint/non-nullable-type-assertion-style': TC('warn'),
'@typescript-eslint/prefer-as-const': OVERRIDE('warn', RECOMMENDED('error')),
'@typescript-eslint/prefer-enum-initializers': 'warn',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'warn',
'@typescript-eslint/prefer-includes': TC('warn'),
'@typescript-eslint/prefer-literal-enum-member': 'error',
'@typescript-eslint/prefer-namespace-keyword': OVERRIDE('warn', RECOMMENDED('error')),
'@typescript-eslint/prefer-nullish-coalescing': TC('error'),
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-readonly': TC('warn'),
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
'@typescript-eslint/prefer-reduce-type-parameter': TC('warn'),
'@typescript-eslint/prefer-regexp-exec': TC(RECOMMENDED('error')),
'@typescript-eslint/prefer-string-starts-ends-with': TC('warn'),
'@typescript-eslint/prefer-ts-expect-error': TC('warn'),
'@typescript-eslint/promise-function-async': TC(OVERRIDE('warn', RECOMMENDED('error'))),
'@typescript-eslint/require-array-sort-compare': TC('off'),
'@typescript-eslint/restrict-plus-operands': TC(OVERRIDE('off', RECOMMENDED('error'))),
'@typescript-eslint/restrict-template-expressions': TC(OVERRIDE('off', RECOMMENDED('error'))),
'@typescript-eslint/sort-type-union-intersection-members': 'off',
'@typescript-eslint/strict-boolean-expressions': TC('off'),
'@typescript-eslint/switch-exhaustiveness-check': TC('error'),
'@typescript-eslint/triple-slash-reference': RECOMMENDED('error'),
'@typescript-eslint/type-annotation-spacing': [
'warn',
{ before: false, after: true, overrides: { 'arrow': { before: true, after: true }}},
],
'@typescript-eslint/typedef': 'off',
'@typescript-eslint/unbound-method': TC(RECOMMENDED('error')),
'@typescript-eslint/unified-signatures': 'error',
// Extension Rules
'@typescript-eslint/brace-style': [ 'warn', '1tbs', { 'allowSingleLine': true }],
'@typescript-eslint/comma-dangle': [ 'warn', 'always-multiline' ],
'@typescript-eslint/comma-spacing': [ 'warn', { 'before': false, 'after': true }],
'@typescript-eslint/default-param-last': 'error',
'@typescript-eslint/dot-notation': TC('warn'),
'@typescript-eslint/func-call-spacing': [ 'warn', 'never' ],
'@typescript-eslint/indent': [
'warn',
4,
{ 'MemberExpression': 0, 'SwitchCase': 1, 'offsetTernaryExpressions': true },
],
'@typescript-eslint/init-declarations': 'off',
'@typescript-eslint/keyword-spacing': [
'warn',
{
'before': true,
'after': true,
'overrides': {
'if': { 'after': false },
'for': { 'after': false },
'while': { 'after': false },
'catch': { 'after': false },
'switch': { 'after': false },
},
},
],
'@typescript-eslint/lines-between-class-members': [ 'warn', 'always', { 'exceptAfterSingleLine': true }],
'@typescript-eslint/no-array-constructor': RECOMMENDED('error'),
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-duplicate-imports': 'error',
'@typescript-eslint/no-empty-function': OVERRIDE('off', RECOMMENDED('error')),
'@typescript-eslint/no-extra-parens': 'off',
'@typescript-eslint/no-extra-semi': RECOMMENDED('error'),
'@typescript-eslint/no-implied-eval': TC(RECOMMENDED('error')),
'@typescript-eslint/no-invalid-this': 'error',
'@typescript-eslint/no-loop-func': 'warn',
'@typescript-eslint/no-loss-of-precision': 'error',
'@typescript-eslint/no-magic-numbers': [
'off',
{ 'ignoreEnums': true, 'ignoreNumericLiteralTypes': true, ignoreReadonlyClassProperties: true },
],
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-throw-literal': TC('error'),
'@typescript-eslint/no-unused-expressions': 'error',
'@typescript-eslint/no-unused-vars': [
RECOMMENDED('warn'),
{
'args': 'after-used',
'argsIgnorePattern': '^_',
'varsIgnorePattern': '^_',
'ignoreRestSiblings': true,
'caughtErrorsIgnorePattern': '^_',
},
],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/object-curly-spacing': [ 'warn', 'always', { arraysInObjects: false, objectsInObjects: false }],
'@typescript-eslint/quotes': [ 'warn', 'single', { 'avoidEscape': true }],
'@typescript-eslint/require-await': TC(OVERRIDE('off', RECOMMENDED('error'))),
'@typescript-eslint/return-await': TC('warn'),
'@typescript-eslint/semi': 'warn',
'@typescript-eslint/space-before-function-paren': [ 'warn', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always' }],
'@typescript-eslint/space-infix-ops': 'warn',
// Best Practices
'eslint-comments/disable-enable-pair': [ RECOMMENDED('error'), { allowWholeFile: true }],
'eslint-comments/no-aggregating-enable': RECOMMENDED('error'),
'eslint-comments/no-duplicate-disable': RECOMMENDED('error'),
'eslint-comments/no-unlimited-disable': RECOMMENDED('error'),
'eslint-comments/no-unused-disable': RECOMMENDED('error'),
'eslint-comments/no-unused-enable': RECOMMENDED('error'),
// Stylistic Issues
'eslint-comments/no-restricted-disable': 'off',
'eslint-comments/no-use': 'off',
'eslint-comments/require-description': 'off',
'no-secrets/no-secrets': [
RECOMMENDED('error'),
{ ignoreContent: [ /^CMTD/u, /^ABCDEF/ui, /^NowIsThe/ui ]},
],
"security/detect-unsafe-regex": OVERRIDE('off', RECOMMENDED('warn')),
"security/detect-buffer-noassert": RECOMMENDED('warn'),
"security/detect-child-process": RECOMMENDED('warn'),
"security/detect-disable-mustache-escape": RECOMMENDED('warn'),
"security/detect-eval-with-expression": RECOMMENDED('warn'),
"security/detect-no-csrf-before-method-override": RECOMMENDED('warn'),
"security/detect-non-literal-fs-filename": OVERRIDE('off', RECOMMENDED('warn')),
"security/detect-non-literal-regexp": OVERRIDE('off', RECOMMENDED('warn')),
"security/detect-non-literal-require": RECOMMENDED('warn'),
"security/detect-object-injection": OVERRIDE('off', RECOMMENDED('warn')),
"security/detect-possible-timing-attacks": RECOMMENDED('warn'),
"security/detect-pseudoRandomBytes": RECOMMENDED('warn'),
'react/boolean-prop-naming': 'off',
'react/button-has-type': 'off',
'react/default-props-match-prop-types': 'off',
'react/destructuring-assignment': 'off',
'react/display-name': OVERRIDE('off', RECOMMENDED('error')),
'react/forbid-component-props': 'off',
'react/forbid-dom-props': 'off',
'react/forbid-elements': 'off',
'react/forbid-foreign-prop-types': 'off',
'react/forbid-prop-types': 'off',
'react/function-component-definition': 'off',
'react/no-access-state-in-setstate': 'off',
'react/no-adjacent-inline-elements': 'off',
'react/no-array-index-key': 'off',
'react/no-children-prop': RECOMMENDED('error'),
'react/no-danger': 'off',
'react/no-danger-with-children': RECOMMENDED('error'),
'react/no-deprecated': RECOMMENDED('error'),
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-direct-mutation-state': RECOMMENDED('error'),
'react/no-find-dom-node': RECOMMENDED('error'),
'react/no-is-mounted': RECOMMENDED('error'),
'react/no-multi-comp': 'off',
'react/no-redundant-should-component-update': 'error',
'react/no-render-return-value': RECOMMENDED('error'),
'react/no-set-state': 'off',
'react/no-string-refs': RECOMMENDED('error'),
'react/no-this-in-sfc': 'error',
'react/no-typos': 'error',
'react/no-unescaped-entities': RECOMMENDED('error'),
'react/no-unknown-property': RECOMMENDED('error'),
'react/no-unsafe': 'error',
'react/no-unused-prop-types': 'error',
'react/no-unused-state': 'error',
'react/no-will-update-set-state': 'error',
'react/prefer-es6-class': [ 'error', 'always' ],
'react/prefer-read-only-props': 'warn',
'react/prefer-stateless-function': 'error',
'react/prop-types': OVERRIDE('off', RECOMMENDED('error')),
'react/react-in-jsx-scope': RECOMMENDED('error'),
'react/require-default-props': OVERRIDE('off', RECOMMENDED('error')),
'react/require-optimization': 'off',
'react/require-render-return': RECOMMENDED('error'),
'react/self-closing-comp': 'warn',
'react/sort-comp': 'off',
'react/sort-prop-types': 'off',
'react/state-in-constructor': 'error',
'react/static-property-placement': 'off',
'react/style-prop-object': 'error',
'react/void-dom-elements-no-children': 'error',
// JSX-specific rules
'react/jsx-boolean-value': [ 'warn', 'always' ],
'react/jsx-child-element-spacing': 'off',
'react/jsx-closing-bracket-location': [ 'warn', 'tag-aligned' ],
'react/jsx-closing-tag-location': 'warn',
'react/jsx-curly-brace-presence': 'warn',
'react/jsx-curly-newline': [ 'warn', 'consistent' ],
'react/jsx-curly-spacing': [ 'warn', 'never' ],
'react/jsx-equals-spacing': [ 'warn', 'never' ],
'react/jsx-filename-extension': [ 'error', { allow: 'as-needed', extensions: [ '.jsx', '.tsx' ]}],
'react/jsx-first-prop-new-line': [ 'warn', 'multiline' ],
'react/jsx-fragments': [ 'warn', 'syntax' ],
'react/jsx-handler-names': 'error',
'react/jsx-indent': [ 'warn', 4 ],
'react/jsx-indent-props': [ 'warn', 4 ],
'react/jsx-key': [
RECOMMENDED('error'),
{ checkFragmentShorthand: true, checkKeyMustBeforeSpread: true },
],
'react/jsx-max-depth': 'off',
'react/jsx-max-props-per-line': 'off',
'react/jsx-newline': 'off',
'react/jsx-no-bind': 'off',
'react/jsx-no-comment-textnodes': RECOMMENDED('error'),
'react/jsx-no-constructed-context-values': 'off',
'react/jsx-no-duplicate-props': RECOMMENDED('error'),
'react/jsx-no-literals': 'off',
'react/jsx-no-script-url': 'error',
'react/jsx-no-target-blank': RECOMMENDED('error'),
'react/jsx-no-undef': RECOMMENDED('error'),
'react/jsx-no-useless-fragment': 'warn',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-pascal-case': 'error',
'react/jsx-props-no-multi-spaces': 'warn',
'react/jsx-props-no-spreading': 'off',
'react/jsx-sort-default-props': 'off',
'react/jsx-sort-props': 'off',
'react/jsx-tag-spacing': [ 'warn', { beforeClosing: 'never' }],
'react/jsx-uses-react': RECOMMENDED('error'),
'react/jsx-uses-vars': RECOMMENDED('error'),
// React-hooks
'react-hooks/rules-of-hooks': RECOMMENDED('error'),
'react-hooks/exhaustive-deps': OVERRIDE('off', RECOMMENDED('error')),
// JSX-A11Y
'jsx-a11y/alt-text': RECOMMENDED('error'),
'jsx-a11y/anchor-has-content': RECOMMENDED('error'),
'jsx-a11y/anchor-is-valid': RECOMMENDED('error'),
'jsx-a11y/aria-activedescendant-has-tabindex': RECOMMENDED('error'),
'jsx-a11y/aria-props': RECOMMENDED('error'),
'jsx-a11y/aria-proptypes': RECOMMENDED('error'),
'jsx-a11y/aria-role': RECOMMENDED('error'),
'jsx-a11y/aria-unsupported-elements': RECOMMENDED('error'),
'jsx-a11y/autocomplete-valid': RECOMMENDED('error'),
'jsx-a11y/click-events-have-key-events': RECOMMENDED('error'),
'jsx-a11y/heading-has-content': RECOMMENDED('error'),
'jsx-a11y/html-has-lang': RECOMMENDED('error'),
'jsx-a11y/iframe-has-title': RECOMMENDED('error'),
'jsx-a11y/img-redundant-alt': RECOMMENDED('error'),
'jsx-a11y/interactive-supports-focus': [
RECOMMENDED('error'),
{ tabbable: [ 'button', 'checkbox', 'link', 'searchbox', 'spinbutton', 'switch', 'textbox' ]},
],
'jsx-a11y/label-has-associated-control': RECOMMENDED('error'),
'jsx-a11y/lang': 'off',
'jsx-a11y/media-has-caption': RECOMMENDED('error'),
'jsx-a11y/mouse-events-have-key-events': RECOMMENDED('error'),
'jsx-a11y/no-access-key': RECOMMENDED('error'),
'jsx-a11y/no-autofocus': OVERRIDE('off', RECOMMENDED('error')),
'jsx-a11y/no-distracting-elements': RECOMMENDED('error'),
'jsx-a11y/no-interactive-element-to-noninteractive-role': [ RECOMMENDED('error'), { tr: [ 'none', 'presentation' ]}],
'jsx-a11y/no-noninteractive-element-interactions': [
RECOMMENDED('error'),
{
handlers: [ 'onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp' ],
alert: [ 'onKeyup', 'onKeyDown', 'onKeyPress' ],
body: [ 'onError', 'onLoad' ],
dialog: [ 'onKeyUp', 'onKeyDown', 'onKeyPress' ],
iframe: [ 'onError', 'onLoad' ],
img: [ 'onError', 'onLoad' ],
},
],
'jsx-a11y/no-noninteractive-element-to-interactive-role': [
RECOMMENDED('error'),
{
ul: [ 'listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid' ],
ol: [ 'listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid' ],
li: [ 'menuitem', 'option', 'row', 'tab', 'treeitem' ],
table: [ 'grid' ],
td: [ 'gridcell' ],
},
],
'jsx-a11y/no-noninteractive-tabindex': [
RECOMMENDED('error'),
{ tags: [], roles: [ 'tabpanel' ], allowExpressionValues: true },
],
'jsx-a11y/no-onchange': OVERRIDE('off', RECOMMENDED('error')),
'jsx-a11y/no-redundant-roles': RECOMMENDED('error'),
'jsx-a11y/no-static-element-interactions': [
RECOMMENDED('error'),
{ handlers: [ 'onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp' ]},
],
'jsx-a11y/role-has-required-aria-props': RECOMMENDED('error'),
'jsx-a11y/role-supports-aria-props': RECOMMENDED('error'),
'jsx-a11y/scope': RECOMMENDED('error'),
'jsx-a11y/tabindex-no-positive': RECOMMENDED('error'),
// tsdoc
'tsdoc/syntax': OVERRIDE('off', RECOMMENDED('warn')),
// SonarJS
// Bug Detection
'sonarjs/no-all-duplicated-branches': RECOMMENDED('error'),
'sonarjs/no-element-overwrite': RECOMMENDED('error'),
'sonarjs/no-empty-collection': RECOMMENDED('error'),
'sonarjs/no-extra-arguments': RECOMMENDED('error'),
'sonarjs/no-identical-conditions': RECOMMENDED('error'),
'sonarjs/no-ignored-return': TC(RECOMMENDED('error')),
'sonarjs/no-one-iteration-loop': RECOMMENDED('error'),
'sonarjs/no-use-of-empty-return-value': RECOMMENDED('error'),
'sonarjs/non-existent-operator': RECOMMENDED('error'),
// Code Smell
'sonarjs/cognitive-complexity': OVERRIDE('off', RECOMMENDED('error')),
'sonarjs/elseif-without-else': 'off',
'sonarjs/max-switch-cases': OVERRIDE('off', RECOMMENDED('error')),
'sonarjs/no-collapsible-if': RECOMMENDED('error'),
'sonarjs/no-collection-size-mischeck': TC(RECOMMENDED('error')),
'sonarjs/no-duplicate-string': OVERRIDE('off', RECOMMENDED('error')),
'sonarjs/no-duplicated-branches': RECOMMENDED('error'),
'sonarjs/no-gratuitous-expressions': RECOMMENDED('error'),
'sonarjs/no-identical-functions': RECOMMENDED('error'),
'sonarjs/no-inverted-boolean-check': RECOMMENDED('error'),
'sonarjs/no-nested-switch': RECOMMENDED('error'),
'sonarjs/no-nested-template-literals': OVERRIDE('off', RECOMMENDED('error')),
'sonarjs/no-redundant-boolean': RECOMMENDED('error'),
'sonarjs/no-redundant-jump': RECOMMENDED('error'),
'sonarjs/no-same-line-conditional': RECOMMENDED('error'),
'sonarjs/no-small-switch': RECOMMENDED('error'),
'sonarjs/no-unused-collection': RECOMMENDED('error'),
'sonarjs/no-useless-catch': RECOMMENDED('error'),
'sonarjs/prefer-immediate-return': RECOMMENDED('error'),
'sonarjs/prefer-single-boolean-return': RECOMMENDED('error'),
'sonarjs/prefer-while': RECOMMENDED('error'),
// Promise
'promise/catch-or-return': OVERRIDE('off', RECOMMENDED('error')),
'promise/no-return-wrap': RECOMMENDED('error'),
'promise/param-names': RECOMMENDED('error'),
'promise/always-return': OVERRIDE('off', RECOMMENDED('error')),
'promise/no-native': 'off',
'promise/no-nesting': RECOMMENDED('warn'),
'promise/no-promise-in-callback': RECOMMENDED('warn'),
'promise/no-new': 'off',
'promise/no-new-statics': RECOMMENDED('error'),
'promise/no-return-in-finally': RECOMMENDED('warn'),
'promise/valid-params': RECOMMENDED('warn'),
'promise/prefer-await-to-then': 'off',
'promise/prefer-await-to-callbacks': 'off',
// Node
// Possible Errors
'node/no-callback-literal': 'warn',
'node/no-exports-assign': RECOMMENDED('error'),
'node/no-extraneous-import': OVERRIDE('off', RECOMMENDED('error')),
'node/no-extraneous-require': OVERRIDE('off', RECOMMENDED('error')),
'node/no-missing-import': OVERRIDE('off', RECOMMENDED('error')),
'node/no-missing-require': OVERRIDE('off', RECOMMENDED('error')),
'node/no-unpublished-bin': OVERRIDE('off', RECOMMENDED('error')),
'node/no-unpublished-import': OVERRIDE('off', RECOMMENDED('error')),
'node/no-unpublished-require': OVERRIDE('off', RECOMMENDED('error')),
'node/no-unsupported-features/es-builtins': OVERRIDE('off', RECOMMENDED('error')),
'node/no-unsupported-features/es-syntax': OVERRIDE('off', RECOMMENDED('error')),
'node/no-unsupported-features/node-builtins': OVERRIDE('off', RECOMMENDED('error')),
'node/process-exit-as-throw': RECOMMENDED('error'),
'node/shebang': OVERRIDE('off', RECOMMENDED('error')),
// Best Practices
'node/no-deprecated-api': RECOMMENDED('error'),
// Stylistic Issues
'node/exports-style': [ 'error', 'module.exports' ],
'node/file-extension-in-import': 'off',
'node/prefer-global/buffer': [ 'error', 'never' ],
'node/prefer-global/console': [ 'error', 'always' ],
'node/prefer-global/process': [ 'error', 'never' ],
'node/prefer-global/text-decoder': [ 'error', 'never' ],
'node/prefer-global/text-encoder': [ 'error', 'never' ],
'node/prefer-global/url-search-params': [ 'error', 'never' ],
'node/prefer-global/url': [ 'error', 'never' ],
'node/prefer-promises/dns': 'error',
'node/prefer-promises/fs': 'error',
// Unicorn
'unicorn/better-regex': RECOMMENDED('error'),
'unicorn/catch-error-name': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/consistent-destructuring': RECOMMENDED('error'),
'unicorn/consistent-function-scoping': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/custom-error-definition': 'error',
'unicorn/empty-brace-spaces': RECOMMENDED('error'),
'unicorn/error-message': RECOMMENDED('error'),
'unicorn/escape-case': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/expiring-todo-comments': [ RECOMMENDED('error'), { allowWarningComments: false } ],
'unicorn/explicit-length-check': RECOMMENDED('error'),
'unicorn/filename-case': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/import-index': 'error',
'unicorn/import-style': RECOMMENDED('error'),
'unicorn/new-for-builtins': RECOMMENDED('error'),
'unicorn/no-abusive-eslint-disable': RECOMMENDED('error'),
'unicorn/no-array-callback-reference': RECOMMENDED('error'),
'unicorn/no-array-for-each': RECOMMENDED('error'),
'unicorn/no-array-method-this-argument': RECOMMENDED('error'),
'unicorn/no-array-push-push': RECOMMENDED('error'),
'unicorn/no-array-reduce': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/no-console-spaces': RECOMMENDED('error'),
'unicorn/no-document-cookie': RECOMMENDED('error'),
'unicorn/no-for-loop': RECOMMENDED('error'),
'unicorn/no-hex-escape': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/no-instanceof-array': RECOMMENDED('error'),
'unicorn/no-keyword-prefix': 'off',
'unicorn/no-lonely-if': RECOMMENDED('error'),
'unicorn/no-nested-ternary': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/no-new-array': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/no-new-buffer': RECOMMENDED('error'),
'unicorn/no-null': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/no-object-as-default-parameter': RECOMMENDED('error'),
'unicorn/no-process-exit': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/no-static-only-class': RECOMMENDED('error'),
'unicorn/no-this-assignment': RECOMMENDED('error'),
'unicorn/no-unreadable-array-destructuring': RECOMMENDED('error'),
'unicorn/no-unsafe-regex': 'off',
'unicorn/no-unused-properties': 'off',
'unicorn/no-useless-undefined': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/no-zero-fractions': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/number-literal-case': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/numeric-separators-style': [ RECOMMENDED('error'), { onlyIfContainsSeparator: true } ],
'unicorn/prefer-add-event-listener': RECOMMENDED('error'),
'unicorn/prefer-array-find': RECOMMENDED('error'),
'unicorn/prefer-array-flat': RECOMMENDED('error'),
'unicorn/prefer-array-index-of': RECOMMENDED('error'),
'unicorn/prefer-array-some': RECOMMENDED('error'),
// TODO [2021-10-01] at isn't implemented yet.
'unicorn/prefer-at': 'off',
'unicorn/prefer-date-now': RECOMMENDED('error'),
'unicorn/prefer-default-parameters': RECOMMENDED('error'),
'unicorn/prefer-dom-node-append': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/prefer-dom-node-dataset': RECOMMENDED('error'),
'unicorn/prefer-dom-node-remove': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/prefer-dom-node-text-content': RECOMMENDED('error'),
'unicorn/prefer-keyboard-event-key': RECOMMENDED('error'),
'unicorn/prefer-math-trunc': RECOMMENDED('error'),
'unicorn/prefer-modern-dom-apis': RECOMMENDED('error'),
'unicorn/prefer-module': REDUNDANT('@typescript-eslint/no-require-imports'),
'unicorn/prefer-negative-index': RECOMMENDED('error'),
'unicorn/prefer-node-protocol': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/prefer-number-properties': [ RECOMMENDED('error'), { checkInfinity: false } ],
// TODO [2021-10-01] hasOwn isn't implemented yet.
'unicorn/prefer-object-has-own': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/prefer-optional-catch-binding': RECOMMENDED('error'),
'unicorn/prefer-prototype-methods': RECOMMENDED('error'),
'unicorn/prefer-query-selector': RECOMMENDED('error'),
'unicorn/prefer-reflect-apply': RECOMMENDED('error'),
'unicorn/prefer-regexp-test': RECOMMENDED('error'),
'unicorn/prefer-set-has': RECOMMENDED('error'),
'unicorn/prefer-spread': OVERRIDE('off', RECOMMENDED('error')),
// TODO [2021-10-01] repaceAll isn't implemented yet.
'unicorn/prefer-string-replace-all': 'off',
'unicorn/prefer-string-slice': RECOMMENDED('error'),
'unicorn/prefer-string-starts-ends-with': RECOMMENDED('error'),
'unicorn/prefer-string-trim-start-end': RECOMMENDED('error'),
'unicorn/prefer-switch': RECOMMENDED('error'),
'unicorn/prefer-ternary': RECOMMENDED('error'),
'unicorn/prefer-top-level-await': 'error',
'unicorn/prefer-type-error': RECOMMENDED('error'),
'unicorn/prevent-abbreviations': OVERRIDE('off', RECOMMENDED('error')),
'unicorn/require-array-join-separator': RECOMMENDED('error'),
'unicorn/require-number-to-fixed-digits-argument': RECOMMENDED('error'),
'unicorn/require-post-message-target-origin': RECOMMENDED('error'),
'unicorn/string-content': 'error',
'unicorn/throw-new-error': RECOMMENDED('error'),
// Import
// Static Analysis
'import/no-unresolved': OVERRIDE('off', RECOMMENDED('error')),
'import/named': RECOMMENDED('off'),
'import/default': RECOMMENDED('error'),
'import/namespace': RECOMMENDED('error'),
'import/no-restricted-paths': 'off',
'import/no-absolute-path': 'error',
'import/no-dynamic-require': 'error',
'import/no-internal-modules': 'off',
'import/no-webpack-loader-syntax': 'off',
'import/no-self-import': 'error',
'import/no-cycle': 'error',
'import/no-useless-path-segments': 'error',
'import/no-relative-packages': 'error',
// Helpful warnings
'import/export': 'error',
'import/no-named-as-default': RECOMMENDED('warn'),
'import/no-named-as-default-member': RECOMMENDED('warn'),
'import/no-deprecated': 'error',
'import/no-extraneous-dependencies': 'off',
'import/no-mutable-exports': 'error',
'import/no-unused-modules': 'warn',
// Module systems
'import/unambiguous': 'off',
'import/no-commonjs': REDUNDANT('@typescript-eslint/no-require-imports'),
'import/no-amd': 'warn',
'import/no-nodejs-modules': 'off',
'import/no-import-module-exports': 'warn',
// Style Guide
'import/first': 'error',
'import/exports-last': 'off',
'import/no-duplicates': RECOMMENDED('warn'),
'import/no-namespace': 'error',
'import/extensions': 'off',
'import/order': 'off',
'import/newline-after-import': 'warn',
'import/prefer-default-export': 'warn',
'import/max-dependencies': 'off',
'import/no-unassigned-import': 'off',
'import/no-named-default': 'warn',
'import/no-default-export': 'off',
'import/group-exports': 'off',
'import/dynamic-import-chunkname': 'warn',
},
overrides: [
{
files: [ '**/*.js' ],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-require-imports': 'off',
},
},
{
files: [ '**/*.css.d.ts' ],
rules: {
'eslint-comments/no-unused-disable': 'off',
},
},
{
files: [ '**/test/*' ],
rules: {
'sonarjs/no-identical-functions': 'off',
},
}
]
});