@tb-dev/eslint-config 5.1.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +233 -145
- package/dist/index.js +233 -145
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -342,10 +342,13 @@ function javascript(options) {
|
|
|
342
342
|
},
|
|
343
343
|
rules: {
|
|
344
344
|
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
345
|
-
"array-callback-return": [
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
345
|
+
"array-callback-return": [
|
|
346
|
+
"error",
|
|
347
|
+
{
|
|
348
|
+
checkForEach: false,
|
|
349
|
+
allowVoid: true
|
|
350
|
+
}
|
|
351
|
+
],
|
|
349
352
|
"block-scoped-var": "error",
|
|
350
353
|
"consistent-this": ["error", "self"],
|
|
351
354
|
"default-case-last": "error",
|
|
@@ -439,10 +442,13 @@ function javascript(options) {
|
|
|
439
442
|
"object-shorthand": ["error", "always"],
|
|
440
443
|
"operator-assignment": ["error", "always"],
|
|
441
444
|
"prefer-arrow-callback": "error",
|
|
442
|
-
"prefer-const": [
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
445
|
+
"prefer-const": [
|
|
446
|
+
"error",
|
|
447
|
+
{
|
|
448
|
+
destructuring: "all",
|
|
449
|
+
ignoreReadBeforeAssign: true
|
|
450
|
+
}
|
|
451
|
+
],
|
|
446
452
|
"prefer-destructuring": "off",
|
|
447
453
|
"prefer-exponentiation-operator": "error",
|
|
448
454
|
"prefer-object-has-own": "error",
|
|
@@ -452,13 +458,16 @@ function javascript(options) {
|
|
|
452
458
|
"prefer-spread": "error",
|
|
453
459
|
"prefer-template": "error",
|
|
454
460
|
"require-atomic-updates": ["error", { allowProperties: true }],
|
|
455
|
-
"sort-imports": [
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
461
|
+
"sort-imports": [
|
|
462
|
+
"error",
|
|
463
|
+
{
|
|
464
|
+
allowSeparatedGroups: false,
|
|
465
|
+
ignoreCase: false,
|
|
466
|
+
ignoreDeclarationSort: true,
|
|
467
|
+
ignoreMemberSort: false,
|
|
468
|
+
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
469
|
+
}
|
|
470
|
+
],
|
|
462
471
|
"symbol-description": "off",
|
|
463
472
|
"use-isnan": "error",
|
|
464
473
|
"valid-typeof": "error",
|
|
@@ -480,41 +489,53 @@ async function typescript(options) {
|
|
|
480
489
|
"no-array-constructor": "off",
|
|
481
490
|
"@typescript-eslint/no-array-constructor": "error",
|
|
482
491
|
"@typescript-eslint/array-type": ["error", { default: "array" }],
|
|
483
|
-
"@typescript-eslint/ban-ts-comment": [
|
|
484
|
-
"
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
492
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
493
|
+
"error",
|
|
494
|
+
{
|
|
495
|
+
"ts-expect-error": "allow-with-description",
|
|
496
|
+
"ts-ignore": true,
|
|
497
|
+
"ts-nocheck": true,
|
|
498
|
+
"ts-check": false,
|
|
499
|
+
minimumDescriptionLength: 3
|
|
500
|
+
}
|
|
501
|
+
],
|
|
490
502
|
"@typescript-eslint/class-literal-property-style": ["error", "fields"],
|
|
491
503
|
"class-methods-use-this": "off",
|
|
492
|
-
"@typescript-eslint/class-methods-use-this": [
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
504
|
+
"@typescript-eslint/class-methods-use-this": [
|
|
505
|
+
"error",
|
|
506
|
+
{
|
|
507
|
+
ignoreOverrideMethods: true,
|
|
508
|
+
ignoreClassesThatImplementAnInterface: "public-fields"
|
|
509
|
+
}
|
|
510
|
+
],
|
|
496
511
|
"@typescript-eslint/consistent-generic-constructors": ["error", "constructor"],
|
|
497
512
|
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
|
|
498
513
|
"consistent-return": "off",
|
|
499
514
|
"@typescript-eslint/consistent-return": "error",
|
|
500
|
-
"@typescript-eslint/consistent-type-assertions": [
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
515
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
516
|
+
"error",
|
|
517
|
+
{
|
|
518
|
+
assertionStyle: "as",
|
|
519
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
520
|
+
}
|
|
521
|
+
],
|
|
504
522
|
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
505
523
|
"dot-notation": "off",
|
|
506
524
|
"@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
|
|
507
525
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
508
|
-
"@typescript-eslint/explicit-member-accessibility": [
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
526
|
+
"@typescript-eslint/explicit-member-accessibility": [
|
|
527
|
+
"error",
|
|
528
|
+
{
|
|
529
|
+
accessibility: "explicit",
|
|
530
|
+
overrides: {
|
|
531
|
+
accessors: "no-public",
|
|
532
|
+
constructors: "no-public",
|
|
533
|
+
methods: "explicit",
|
|
534
|
+
properties: "explicit",
|
|
535
|
+
parameterProperties: "explicit"
|
|
536
|
+
}
|
|
516
537
|
}
|
|
517
|
-
|
|
538
|
+
],
|
|
518
539
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
519
540
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
520
541
|
camelcase: "off",
|
|
@@ -526,10 +547,14 @@ async function typescript(options) {
|
|
|
526
547
|
leadingUnderscore: "allow"
|
|
527
548
|
},
|
|
528
549
|
{
|
|
529
|
-
selector: ["classicAccessor", "classMethod", "
|
|
550
|
+
selector: ["classicAccessor", "classMethod", "parameter", "parameterProperty"],
|
|
530
551
|
format: ["strictCamelCase"],
|
|
531
552
|
leadingUnderscore: "allow"
|
|
532
553
|
},
|
|
554
|
+
{
|
|
555
|
+
selector: ["function"],
|
|
556
|
+
format: ["strictCamelCase", "StrictPascalCase"]
|
|
557
|
+
},
|
|
533
558
|
{
|
|
534
559
|
selector: ["class", "enum", "enumMember", "interface", "typeAlias", "typeParameter"],
|
|
535
560
|
format: ["StrictPascalCase"]
|
|
@@ -538,52 +563,67 @@ async function typescript(options) {
|
|
|
538
563
|
"@typescript-eslint/no-array-delete": "error",
|
|
539
564
|
"@typescript-eslint/no-base-to-string": "error",
|
|
540
565
|
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
541
|
-
"@typescript-eslint/no-confusing-void-expression": [
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
566
|
+
"@typescript-eslint/no-confusing-void-expression": [
|
|
567
|
+
"error",
|
|
568
|
+
{
|
|
569
|
+
ignoreArrowShorthand: true,
|
|
570
|
+
ignoreVoidOperator: true
|
|
571
|
+
}
|
|
572
|
+
],
|
|
545
573
|
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
546
574
|
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
|
547
575
|
"@typescript-eslint/no-dynamic-delete": "error",
|
|
548
576
|
"no-empty-function": "off",
|
|
549
577
|
"@typescript-eslint/no-empty-function": "error",
|
|
550
|
-
"@typescript-eslint/no-empty-object-type": [
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
578
|
+
"@typescript-eslint/no-empty-object-type": [
|
|
579
|
+
"error",
|
|
580
|
+
{
|
|
581
|
+
allowInterfaces: "never",
|
|
582
|
+
allowObjectTypes: "never"
|
|
583
|
+
}
|
|
584
|
+
],
|
|
554
585
|
"@typescript-eslint/no-explicit-any": ["error", { fixToUnknown: true }],
|
|
555
586
|
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
556
587
|
"@typescript-eslint/no-extraneous-class": "error",
|
|
557
|
-
"@typescript-eslint/no-floating-promises": [
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
588
|
+
"@typescript-eslint/no-floating-promises": [
|
|
589
|
+
"error",
|
|
590
|
+
{
|
|
591
|
+
allowForKnownSafePromises: options.knownSafePromises ?? [],
|
|
592
|
+
checkThenables: false,
|
|
593
|
+
ignoreIIFE: true,
|
|
594
|
+
ignoreVoid: true
|
|
595
|
+
}
|
|
596
|
+
],
|
|
563
597
|
"@typescript-eslint/no-for-in-array": "error",
|
|
564
598
|
"no-implied-eval": "off",
|
|
565
599
|
"@typescript-eslint/no-implied-eval": "error",
|
|
566
600
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
567
601
|
"@typescript-eslint/no-inferrable-types": "error",
|
|
568
|
-
"@typescript-eslint/no-invalid-void-type": [
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
602
|
+
"@typescript-eslint/no-invalid-void-type": [
|
|
603
|
+
"error",
|
|
604
|
+
{
|
|
605
|
+
allowInGenericTypeArguments: true,
|
|
606
|
+
allowAsThisParameter: true
|
|
607
|
+
}
|
|
608
|
+
],
|
|
572
609
|
"no-loop-func": "off",
|
|
573
610
|
"@typescript-eslint/no-loop-func": "error",
|
|
574
611
|
"@typescript-eslint/no-meaningless-void-operator": "error",
|
|
575
612
|
"@typescript-eslint/no-misused-new": "error",
|
|
576
|
-
"@typescript-eslint/no-misused-promises": [
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
613
|
+
"@typescript-eslint/no-misused-promises": [
|
|
614
|
+
"error",
|
|
615
|
+
{
|
|
616
|
+
checksConditionals: true,
|
|
617
|
+
checksSpreads: true,
|
|
618
|
+
checksVoidReturn: {
|
|
619
|
+
arguments: true,
|
|
620
|
+
attributes: true,
|
|
621
|
+
properties: true,
|
|
622
|
+
returns: true,
|
|
623
|
+
variables: true
|
|
624
|
+
}
|
|
585
625
|
}
|
|
586
|
-
|
|
626
|
+
],
|
|
587
627
|
"@typescript-eslint/no-mixed-enums": "error",
|
|
588
628
|
"@typescript-eslint/no-namespace": "error",
|
|
589
629
|
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
@@ -594,10 +634,13 @@ async function typescript(options) {
|
|
|
594
634
|
"no-shadow": "off",
|
|
595
635
|
"@typescript-eslint/no-shadow": "error",
|
|
596
636
|
"@typescript-eslint/no-this-alias": "error",
|
|
597
|
-
"@typescript-eslint/no-unnecessary-boolean-literal-compare": [
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
637
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": [
|
|
638
|
+
"error",
|
|
639
|
+
{
|
|
640
|
+
allowComparingNullableBooleansToTrue: false,
|
|
641
|
+
allowComparingNullableBooleansToFalse: true
|
|
642
|
+
}
|
|
643
|
+
],
|
|
601
644
|
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
602
645
|
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "error",
|
|
603
646
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
@@ -617,21 +660,27 @@ async function typescript(options) {
|
|
|
617
660
|
"no-unused-expressions": "off",
|
|
618
661
|
"@typescript-eslint/no-unused-expressions": ["error", { allowTaggedTemplates: true }],
|
|
619
662
|
"no-use-before-define": "off",
|
|
620
|
-
"@typescript-eslint/no-use-before-define": [
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
663
|
+
"@typescript-eslint/no-use-before-define": [
|
|
664
|
+
"error",
|
|
665
|
+
{
|
|
666
|
+
functions: false,
|
|
667
|
+
enums: true,
|
|
668
|
+
typedefs: false
|
|
669
|
+
}
|
|
670
|
+
],
|
|
625
671
|
"no-useless-constructor": "off",
|
|
626
672
|
"@typescript-eslint/no-useless-constructor": "error",
|
|
627
673
|
"@typescript-eslint/no-useless-empty-export": "error",
|
|
628
674
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
629
675
|
"@typescript-eslint/non-nullable-type-assertion-style": "error",
|
|
630
676
|
"no-throw-literal": "off",
|
|
631
|
-
"@typescript-eslint/only-throw-error": [
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
677
|
+
"@typescript-eslint/only-throw-error": [
|
|
678
|
+
"error",
|
|
679
|
+
{
|
|
680
|
+
allowThrowingAny: false,
|
|
681
|
+
allowThrowingUnknown: false
|
|
682
|
+
}
|
|
683
|
+
],
|
|
635
684
|
"@typescript-eslint/prefer-as-const": "error",
|
|
636
685
|
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
637
686
|
"@typescript-eslint/prefer-find": "error",
|
|
@@ -639,17 +688,20 @@ async function typescript(options) {
|
|
|
639
688
|
"@typescript-eslint/prefer-function-type": "error",
|
|
640
689
|
"@typescript-eslint/prefer-includes": "error",
|
|
641
690
|
"@typescript-eslint/prefer-literal-enum-member": "error",
|
|
642
|
-
"@typescript-eslint/prefer-nullish-coalescing": [
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
691
|
+
"@typescript-eslint/prefer-nullish-coalescing": [
|
|
692
|
+
"error",
|
|
693
|
+
{
|
|
694
|
+
ignoreTernaryTests: false,
|
|
695
|
+
ignoreConditionalTests: false,
|
|
696
|
+
ignoreMixedLogicalExpressions: false,
|
|
697
|
+
ignorePrimitives: {
|
|
698
|
+
bigint: false,
|
|
699
|
+
boolean: false,
|
|
700
|
+
number: false,
|
|
701
|
+
string: false
|
|
702
|
+
}
|
|
651
703
|
}
|
|
652
|
-
|
|
704
|
+
],
|
|
653
705
|
"@typescript-eslint/prefer-optional-chain": "error",
|
|
654
706
|
"prefer-promise-reject-errors": "off",
|
|
655
707
|
"@typescript-eslint/prefer-promise-reject-errors": "error",
|
|
@@ -668,7 +720,10 @@ async function typescript(options) {
|
|
|
668
720
|
"no-return-await": "off",
|
|
669
721
|
"@typescript-eslint/return-await": ["error", "in-try-catch"],
|
|
670
722
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
671
|
-
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
723
|
+
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
724
|
+
"error",
|
|
725
|
+
{ requireDefaultForNonUnion: true }
|
|
726
|
+
],
|
|
672
727
|
"@typescript-eslint/unbound-method": "error",
|
|
673
728
|
"@typescript-eslint/unified-signatures": ["error", { ignoreDifferentlyNamedParameters: true }],
|
|
674
729
|
"@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
|
|
@@ -698,61 +753,94 @@ async function perfectionist(options) {
|
|
|
698
753
|
return {
|
|
699
754
|
plugins: { perfectionist: plugin },
|
|
700
755
|
rules: {
|
|
701
|
-
"perfectionist/sort-array-includes": [
|
|
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
|
-
|
|
756
|
+
"perfectionist/sort-array-includes": [
|
|
757
|
+
"error",
|
|
758
|
+
{
|
|
759
|
+
type: "natural",
|
|
760
|
+
order: "asc",
|
|
761
|
+
ignoreCase: true,
|
|
762
|
+
groupKind: "literals-first"
|
|
763
|
+
}
|
|
764
|
+
],
|
|
765
|
+
"perfectionist/sort-enums": [
|
|
766
|
+
"error",
|
|
767
|
+
{
|
|
768
|
+
type: "natural",
|
|
769
|
+
order: "asc"
|
|
770
|
+
}
|
|
771
|
+
],
|
|
772
|
+
"perfectionist/sort-exports": [
|
|
773
|
+
"error",
|
|
774
|
+
{
|
|
775
|
+
type: "line-length",
|
|
776
|
+
order: "asc",
|
|
777
|
+
ignoreCase: true
|
|
778
|
+
}
|
|
779
|
+
],
|
|
780
|
+
"perfectionist/sort-imports": [
|
|
781
|
+
"error",
|
|
782
|
+
{
|
|
783
|
+
type: "line-length",
|
|
784
|
+
order: "asc",
|
|
785
|
+
ignoreCase: true,
|
|
786
|
+
newlinesBetween: "never",
|
|
787
|
+
groups: [["side-effect-style", "side-effect"], "unknown"]
|
|
788
|
+
}
|
|
789
|
+
],
|
|
790
|
+
"perfectionist/sort-interfaces": [
|
|
791
|
+
"error",
|
|
792
|
+
{
|
|
793
|
+
type: "natural",
|
|
794
|
+
order: "asc",
|
|
795
|
+
partitionByNewLine: true
|
|
796
|
+
}
|
|
797
|
+
],
|
|
798
|
+
"perfectionist/sort-intersection-types": [
|
|
799
|
+
"error",
|
|
800
|
+
{
|
|
801
|
+
type: "natural",
|
|
802
|
+
order: "asc"
|
|
803
|
+
}
|
|
804
|
+
],
|
|
805
|
+
"perfectionist/sort-maps": [
|
|
806
|
+
"error",
|
|
807
|
+
{
|
|
808
|
+
type: "natural",
|
|
809
|
+
order: "asc"
|
|
810
|
+
}
|
|
811
|
+
],
|
|
812
|
+
"perfectionist/sort-named-exports": [
|
|
813
|
+
"error",
|
|
814
|
+
{
|
|
815
|
+
type: "natural",
|
|
816
|
+
order: "asc"
|
|
817
|
+
}
|
|
818
|
+
],
|
|
740
819
|
"sort-imports": "off",
|
|
741
|
-
"perfectionist/sort-named-imports": [
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
820
|
+
"perfectionist/sort-named-imports": [
|
|
821
|
+
"error",
|
|
822
|
+
{
|
|
823
|
+
type: "natural",
|
|
824
|
+
order: "asc"
|
|
825
|
+
}
|
|
826
|
+
],
|
|
745
827
|
"@typescript-eslint/adjacent-overload-signatures": "off",
|
|
746
|
-
"perfectionist/sort-object-types": [
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
828
|
+
"perfectionist/sort-object-types": [
|
|
829
|
+
"error",
|
|
830
|
+
{
|
|
831
|
+
type: "natural",
|
|
832
|
+
order: "asc",
|
|
833
|
+
partitionByNewLine: true
|
|
834
|
+
}
|
|
835
|
+
],
|
|
836
|
+
"perfectionist/sort-switch-case": [
|
|
837
|
+
"error",
|
|
838
|
+
{
|
|
839
|
+
type: "natural",
|
|
840
|
+
order: "asc",
|
|
841
|
+
ignoreCase: true
|
|
842
|
+
}
|
|
843
|
+
],
|
|
756
844
|
...options.overrides?.perfectionist
|
|
757
845
|
}
|
|
758
846
|
};
|
package/dist/index.js
CHANGED
|
@@ -338,10 +338,13 @@ function javascript(options) {
|
|
|
338
338
|
},
|
|
339
339
|
rules: {
|
|
340
340
|
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
341
|
-
"array-callback-return": [
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
341
|
+
"array-callback-return": [
|
|
342
|
+
"error",
|
|
343
|
+
{
|
|
344
|
+
checkForEach: false,
|
|
345
|
+
allowVoid: true
|
|
346
|
+
}
|
|
347
|
+
],
|
|
345
348
|
"block-scoped-var": "error",
|
|
346
349
|
"consistent-this": ["error", "self"],
|
|
347
350
|
"default-case-last": "error",
|
|
@@ -435,10 +438,13 @@ function javascript(options) {
|
|
|
435
438
|
"object-shorthand": ["error", "always"],
|
|
436
439
|
"operator-assignment": ["error", "always"],
|
|
437
440
|
"prefer-arrow-callback": "error",
|
|
438
|
-
"prefer-const": [
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
441
|
+
"prefer-const": [
|
|
442
|
+
"error",
|
|
443
|
+
{
|
|
444
|
+
destructuring: "all",
|
|
445
|
+
ignoreReadBeforeAssign: true
|
|
446
|
+
}
|
|
447
|
+
],
|
|
442
448
|
"prefer-destructuring": "off",
|
|
443
449
|
"prefer-exponentiation-operator": "error",
|
|
444
450
|
"prefer-object-has-own": "error",
|
|
@@ -448,13 +454,16 @@ function javascript(options) {
|
|
|
448
454
|
"prefer-spread": "error",
|
|
449
455
|
"prefer-template": "error",
|
|
450
456
|
"require-atomic-updates": ["error", { allowProperties: true }],
|
|
451
|
-
"sort-imports": [
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
457
|
+
"sort-imports": [
|
|
458
|
+
"error",
|
|
459
|
+
{
|
|
460
|
+
allowSeparatedGroups: false,
|
|
461
|
+
ignoreCase: false,
|
|
462
|
+
ignoreDeclarationSort: true,
|
|
463
|
+
ignoreMemberSort: false,
|
|
464
|
+
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
465
|
+
}
|
|
466
|
+
],
|
|
458
467
|
"symbol-description": "off",
|
|
459
468
|
"use-isnan": "error",
|
|
460
469
|
"valid-typeof": "error",
|
|
@@ -476,41 +485,53 @@ async function typescript(options) {
|
|
|
476
485
|
"no-array-constructor": "off",
|
|
477
486
|
"@typescript-eslint/no-array-constructor": "error",
|
|
478
487
|
"@typescript-eslint/array-type": ["error", { default: "array" }],
|
|
479
|
-
"@typescript-eslint/ban-ts-comment": [
|
|
480
|
-
"
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
488
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
489
|
+
"error",
|
|
490
|
+
{
|
|
491
|
+
"ts-expect-error": "allow-with-description",
|
|
492
|
+
"ts-ignore": true,
|
|
493
|
+
"ts-nocheck": true,
|
|
494
|
+
"ts-check": false,
|
|
495
|
+
minimumDescriptionLength: 3
|
|
496
|
+
}
|
|
497
|
+
],
|
|
486
498
|
"@typescript-eslint/class-literal-property-style": ["error", "fields"],
|
|
487
499
|
"class-methods-use-this": "off",
|
|
488
|
-
"@typescript-eslint/class-methods-use-this": [
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
500
|
+
"@typescript-eslint/class-methods-use-this": [
|
|
501
|
+
"error",
|
|
502
|
+
{
|
|
503
|
+
ignoreOverrideMethods: true,
|
|
504
|
+
ignoreClassesThatImplementAnInterface: "public-fields"
|
|
505
|
+
}
|
|
506
|
+
],
|
|
492
507
|
"@typescript-eslint/consistent-generic-constructors": ["error", "constructor"],
|
|
493
508
|
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
|
|
494
509
|
"consistent-return": "off",
|
|
495
510
|
"@typescript-eslint/consistent-return": "error",
|
|
496
|
-
"@typescript-eslint/consistent-type-assertions": [
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
511
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
512
|
+
"error",
|
|
513
|
+
{
|
|
514
|
+
assertionStyle: "as",
|
|
515
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
516
|
+
}
|
|
517
|
+
],
|
|
500
518
|
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
501
519
|
"dot-notation": "off",
|
|
502
520
|
"@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
|
|
503
521
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
504
|
-
"@typescript-eslint/explicit-member-accessibility": [
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
522
|
+
"@typescript-eslint/explicit-member-accessibility": [
|
|
523
|
+
"error",
|
|
524
|
+
{
|
|
525
|
+
accessibility: "explicit",
|
|
526
|
+
overrides: {
|
|
527
|
+
accessors: "no-public",
|
|
528
|
+
constructors: "no-public",
|
|
529
|
+
methods: "explicit",
|
|
530
|
+
properties: "explicit",
|
|
531
|
+
parameterProperties: "explicit"
|
|
532
|
+
}
|
|
512
533
|
}
|
|
513
|
-
|
|
534
|
+
],
|
|
514
535
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
515
536
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
516
537
|
camelcase: "off",
|
|
@@ -522,10 +543,14 @@ async function typescript(options) {
|
|
|
522
543
|
leadingUnderscore: "allow"
|
|
523
544
|
},
|
|
524
545
|
{
|
|
525
|
-
selector: ["classicAccessor", "classMethod", "
|
|
546
|
+
selector: ["classicAccessor", "classMethod", "parameter", "parameterProperty"],
|
|
526
547
|
format: ["strictCamelCase"],
|
|
527
548
|
leadingUnderscore: "allow"
|
|
528
549
|
},
|
|
550
|
+
{
|
|
551
|
+
selector: ["function"],
|
|
552
|
+
format: ["strictCamelCase", "StrictPascalCase"]
|
|
553
|
+
},
|
|
529
554
|
{
|
|
530
555
|
selector: ["class", "enum", "enumMember", "interface", "typeAlias", "typeParameter"],
|
|
531
556
|
format: ["StrictPascalCase"]
|
|
@@ -534,52 +559,67 @@ async function typescript(options) {
|
|
|
534
559
|
"@typescript-eslint/no-array-delete": "error",
|
|
535
560
|
"@typescript-eslint/no-base-to-string": "error",
|
|
536
561
|
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
537
|
-
"@typescript-eslint/no-confusing-void-expression": [
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
562
|
+
"@typescript-eslint/no-confusing-void-expression": [
|
|
563
|
+
"error",
|
|
564
|
+
{
|
|
565
|
+
ignoreArrowShorthand: true,
|
|
566
|
+
ignoreVoidOperator: true
|
|
567
|
+
}
|
|
568
|
+
],
|
|
541
569
|
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
542
570
|
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
|
543
571
|
"@typescript-eslint/no-dynamic-delete": "error",
|
|
544
572
|
"no-empty-function": "off",
|
|
545
573
|
"@typescript-eslint/no-empty-function": "error",
|
|
546
|
-
"@typescript-eslint/no-empty-object-type": [
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
574
|
+
"@typescript-eslint/no-empty-object-type": [
|
|
575
|
+
"error",
|
|
576
|
+
{
|
|
577
|
+
allowInterfaces: "never",
|
|
578
|
+
allowObjectTypes: "never"
|
|
579
|
+
}
|
|
580
|
+
],
|
|
550
581
|
"@typescript-eslint/no-explicit-any": ["error", { fixToUnknown: true }],
|
|
551
582
|
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
552
583
|
"@typescript-eslint/no-extraneous-class": "error",
|
|
553
|
-
"@typescript-eslint/no-floating-promises": [
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
584
|
+
"@typescript-eslint/no-floating-promises": [
|
|
585
|
+
"error",
|
|
586
|
+
{
|
|
587
|
+
allowForKnownSafePromises: options.knownSafePromises ?? [],
|
|
588
|
+
checkThenables: false,
|
|
589
|
+
ignoreIIFE: true,
|
|
590
|
+
ignoreVoid: true
|
|
591
|
+
}
|
|
592
|
+
],
|
|
559
593
|
"@typescript-eslint/no-for-in-array": "error",
|
|
560
594
|
"no-implied-eval": "off",
|
|
561
595
|
"@typescript-eslint/no-implied-eval": "error",
|
|
562
596
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
563
597
|
"@typescript-eslint/no-inferrable-types": "error",
|
|
564
|
-
"@typescript-eslint/no-invalid-void-type": [
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
598
|
+
"@typescript-eslint/no-invalid-void-type": [
|
|
599
|
+
"error",
|
|
600
|
+
{
|
|
601
|
+
allowInGenericTypeArguments: true,
|
|
602
|
+
allowAsThisParameter: true
|
|
603
|
+
}
|
|
604
|
+
],
|
|
568
605
|
"no-loop-func": "off",
|
|
569
606
|
"@typescript-eslint/no-loop-func": "error",
|
|
570
607
|
"@typescript-eslint/no-meaningless-void-operator": "error",
|
|
571
608
|
"@typescript-eslint/no-misused-new": "error",
|
|
572
|
-
"@typescript-eslint/no-misused-promises": [
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
609
|
+
"@typescript-eslint/no-misused-promises": [
|
|
610
|
+
"error",
|
|
611
|
+
{
|
|
612
|
+
checksConditionals: true,
|
|
613
|
+
checksSpreads: true,
|
|
614
|
+
checksVoidReturn: {
|
|
615
|
+
arguments: true,
|
|
616
|
+
attributes: true,
|
|
617
|
+
properties: true,
|
|
618
|
+
returns: true,
|
|
619
|
+
variables: true
|
|
620
|
+
}
|
|
581
621
|
}
|
|
582
|
-
|
|
622
|
+
],
|
|
583
623
|
"@typescript-eslint/no-mixed-enums": "error",
|
|
584
624
|
"@typescript-eslint/no-namespace": "error",
|
|
585
625
|
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
@@ -590,10 +630,13 @@ async function typescript(options) {
|
|
|
590
630
|
"no-shadow": "off",
|
|
591
631
|
"@typescript-eslint/no-shadow": "error",
|
|
592
632
|
"@typescript-eslint/no-this-alias": "error",
|
|
593
|
-
"@typescript-eslint/no-unnecessary-boolean-literal-compare": [
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
633
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": [
|
|
634
|
+
"error",
|
|
635
|
+
{
|
|
636
|
+
allowComparingNullableBooleansToTrue: false,
|
|
637
|
+
allowComparingNullableBooleansToFalse: true
|
|
638
|
+
}
|
|
639
|
+
],
|
|
597
640
|
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
598
641
|
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "error",
|
|
599
642
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
@@ -613,21 +656,27 @@ async function typescript(options) {
|
|
|
613
656
|
"no-unused-expressions": "off",
|
|
614
657
|
"@typescript-eslint/no-unused-expressions": ["error", { allowTaggedTemplates: true }],
|
|
615
658
|
"no-use-before-define": "off",
|
|
616
|
-
"@typescript-eslint/no-use-before-define": [
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
659
|
+
"@typescript-eslint/no-use-before-define": [
|
|
660
|
+
"error",
|
|
661
|
+
{
|
|
662
|
+
functions: false,
|
|
663
|
+
enums: true,
|
|
664
|
+
typedefs: false
|
|
665
|
+
}
|
|
666
|
+
],
|
|
621
667
|
"no-useless-constructor": "off",
|
|
622
668
|
"@typescript-eslint/no-useless-constructor": "error",
|
|
623
669
|
"@typescript-eslint/no-useless-empty-export": "error",
|
|
624
670
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
625
671
|
"@typescript-eslint/non-nullable-type-assertion-style": "error",
|
|
626
672
|
"no-throw-literal": "off",
|
|
627
|
-
"@typescript-eslint/only-throw-error": [
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
673
|
+
"@typescript-eslint/only-throw-error": [
|
|
674
|
+
"error",
|
|
675
|
+
{
|
|
676
|
+
allowThrowingAny: false,
|
|
677
|
+
allowThrowingUnknown: false
|
|
678
|
+
}
|
|
679
|
+
],
|
|
631
680
|
"@typescript-eslint/prefer-as-const": "error",
|
|
632
681
|
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
633
682
|
"@typescript-eslint/prefer-find": "error",
|
|
@@ -635,17 +684,20 @@ async function typescript(options) {
|
|
|
635
684
|
"@typescript-eslint/prefer-function-type": "error",
|
|
636
685
|
"@typescript-eslint/prefer-includes": "error",
|
|
637
686
|
"@typescript-eslint/prefer-literal-enum-member": "error",
|
|
638
|
-
"@typescript-eslint/prefer-nullish-coalescing": [
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
687
|
+
"@typescript-eslint/prefer-nullish-coalescing": [
|
|
688
|
+
"error",
|
|
689
|
+
{
|
|
690
|
+
ignoreTernaryTests: false,
|
|
691
|
+
ignoreConditionalTests: false,
|
|
692
|
+
ignoreMixedLogicalExpressions: false,
|
|
693
|
+
ignorePrimitives: {
|
|
694
|
+
bigint: false,
|
|
695
|
+
boolean: false,
|
|
696
|
+
number: false,
|
|
697
|
+
string: false
|
|
698
|
+
}
|
|
647
699
|
}
|
|
648
|
-
|
|
700
|
+
],
|
|
649
701
|
"@typescript-eslint/prefer-optional-chain": "error",
|
|
650
702
|
"prefer-promise-reject-errors": "off",
|
|
651
703
|
"@typescript-eslint/prefer-promise-reject-errors": "error",
|
|
@@ -664,7 +716,10 @@ async function typescript(options) {
|
|
|
664
716
|
"no-return-await": "off",
|
|
665
717
|
"@typescript-eslint/return-await": ["error", "in-try-catch"],
|
|
666
718
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
667
|
-
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
719
|
+
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
720
|
+
"error",
|
|
721
|
+
{ requireDefaultForNonUnion: true }
|
|
722
|
+
],
|
|
668
723
|
"@typescript-eslint/unbound-method": "error",
|
|
669
724
|
"@typescript-eslint/unified-signatures": ["error", { ignoreDifferentlyNamedParameters: true }],
|
|
670
725
|
"@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
|
|
@@ -694,61 +749,94 @@ async function perfectionist(options) {
|
|
|
694
749
|
return {
|
|
695
750
|
plugins: { perfectionist: plugin },
|
|
696
751
|
rules: {
|
|
697
|
-
"perfectionist/sort-array-includes": [
|
|
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
|
-
|
|
752
|
+
"perfectionist/sort-array-includes": [
|
|
753
|
+
"error",
|
|
754
|
+
{
|
|
755
|
+
type: "natural",
|
|
756
|
+
order: "asc",
|
|
757
|
+
ignoreCase: true,
|
|
758
|
+
groupKind: "literals-first"
|
|
759
|
+
}
|
|
760
|
+
],
|
|
761
|
+
"perfectionist/sort-enums": [
|
|
762
|
+
"error",
|
|
763
|
+
{
|
|
764
|
+
type: "natural",
|
|
765
|
+
order: "asc"
|
|
766
|
+
}
|
|
767
|
+
],
|
|
768
|
+
"perfectionist/sort-exports": [
|
|
769
|
+
"error",
|
|
770
|
+
{
|
|
771
|
+
type: "line-length",
|
|
772
|
+
order: "asc",
|
|
773
|
+
ignoreCase: true
|
|
774
|
+
}
|
|
775
|
+
],
|
|
776
|
+
"perfectionist/sort-imports": [
|
|
777
|
+
"error",
|
|
778
|
+
{
|
|
779
|
+
type: "line-length",
|
|
780
|
+
order: "asc",
|
|
781
|
+
ignoreCase: true,
|
|
782
|
+
newlinesBetween: "never",
|
|
783
|
+
groups: [["side-effect-style", "side-effect"], "unknown"]
|
|
784
|
+
}
|
|
785
|
+
],
|
|
786
|
+
"perfectionist/sort-interfaces": [
|
|
787
|
+
"error",
|
|
788
|
+
{
|
|
789
|
+
type: "natural",
|
|
790
|
+
order: "asc",
|
|
791
|
+
partitionByNewLine: true
|
|
792
|
+
}
|
|
793
|
+
],
|
|
794
|
+
"perfectionist/sort-intersection-types": [
|
|
795
|
+
"error",
|
|
796
|
+
{
|
|
797
|
+
type: "natural",
|
|
798
|
+
order: "asc"
|
|
799
|
+
}
|
|
800
|
+
],
|
|
801
|
+
"perfectionist/sort-maps": [
|
|
802
|
+
"error",
|
|
803
|
+
{
|
|
804
|
+
type: "natural",
|
|
805
|
+
order: "asc"
|
|
806
|
+
}
|
|
807
|
+
],
|
|
808
|
+
"perfectionist/sort-named-exports": [
|
|
809
|
+
"error",
|
|
810
|
+
{
|
|
811
|
+
type: "natural",
|
|
812
|
+
order: "asc"
|
|
813
|
+
}
|
|
814
|
+
],
|
|
736
815
|
"sort-imports": "off",
|
|
737
|
-
"perfectionist/sort-named-imports": [
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
816
|
+
"perfectionist/sort-named-imports": [
|
|
817
|
+
"error",
|
|
818
|
+
{
|
|
819
|
+
type: "natural",
|
|
820
|
+
order: "asc"
|
|
821
|
+
}
|
|
822
|
+
],
|
|
741
823
|
"@typescript-eslint/adjacent-overload-signatures": "off",
|
|
742
|
-
"perfectionist/sort-object-types": [
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
824
|
+
"perfectionist/sort-object-types": [
|
|
825
|
+
"error",
|
|
826
|
+
{
|
|
827
|
+
type: "natural",
|
|
828
|
+
order: "asc",
|
|
829
|
+
partitionByNewLine: true
|
|
830
|
+
}
|
|
831
|
+
],
|
|
832
|
+
"perfectionist/sort-switch-case": [
|
|
833
|
+
"error",
|
|
834
|
+
{
|
|
835
|
+
type: "natural",
|
|
836
|
+
order: "asc",
|
|
837
|
+
ignoreCase: true
|
|
838
|
+
}
|
|
839
|
+
],
|
|
752
840
|
...options.overrides?.perfectionist
|
|
753
841
|
}
|
|
754
842
|
};
|