@tb-dev/eslint-config 4.0.0 → 4.1.1

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 CHANGED
@@ -627,7 +627,6 @@ async function typescript(options) {
627
627
  minimumDescriptionLength: 3
628
628
  }
629
629
  ],
630
- "@typescript-eslint/ban-types": "error",
631
630
  "@typescript-eslint/class-literal-property-style": ["error", "fields"],
632
631
  "class-methods-use-this": "off",
633
632
  "@typescript-eslint/class-methods-use-this": [
@@ -698,10 +697,21 @@ async function typescript(options) {
698
697
  "no-empty-function": "off",
699
698
  "@typescript-eslint/no-empty-function": "error",
700
699
  "@typescript-eslint/no-empty-interface": "error",
700
+ "@typescript-eslint/no-empty-object-type": [
701
+ "error",
702
+ { allowInterfaces: "never", allowObjectTypes: "never" }
703
+ ],
701
704
  "@typescript-eslint/no-explicit-any": ["error", { fixToUnknown: true }],
702
705
  "@typescript-eslint/no-extra-non-null-assertion": "error",
703
706
  "@typescript-eslint/no-extraneous-class": "error",
704
- "@typescript-eslint/no-floating-promises": ["error", { ignoreIIFE: true, ignoreVoid: true }],
707
+ "@typescript-eslint/no-floating-promises": [
708
+ "error",
709
+ {
710
+ ignoreIIFE: true,
711
+ ignoreVoid: true,
712
+ allowForKnownSafePromises: options.knownSafePromises ?? []
713
+ }
714
+ ],
705
715
  "@typescript-eslint/no-for-in-array": "error",
706
716
  "no-implied-eval": "off",
707
717
  "@typescript-eslint/no-implied-eval": "error",
@@ -752,14 +762,17 @@ async function typescript(options) {
752
762
  }
753
763
  ],
754
764
  "@typescript-eslint/no-unnecessary-condition": "error",
765
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": "error",
755
766
  "@typescript-eslint/no-unnecessary-qualifier": "error",
756
767
  "@typescript-eslint/no-unnecessary-type-arguments": "error",
757
768
  "@typescript-eslint/no-unnecessary-type-assertion": "error",
758
769
  "@typescript-eslint/no-unnecessary-type-constraint": "error",
770
+ "@typescript-eslint/no-unnecessary-type-parameters": "error",
759
771
  "@typescript-eslint/no-unsafe-argument": "off",
760
772
  "@typescript-eslint/no-unsafe-assignment": "off",
761
773
  "@typescript-eslint/no-unsafe-call": "error",
762
774
  "@typescript-eslint/no-unsafe-declaration-merging": "error",
775
+ "@typescript-eslint/no-unsafe-function-type": "error",
763
776
  "@typescript-eslint/no-unsafe-enum-comparison": "off",
764
777
  "@typescript-eslint/no-unsafe-member-access": "error",
765
778
  "@typescript-eslint/no-unsafe-return": "off",
@@ -784,6 +797,7 @@ async function typescript(options) {
784
797
  "@typescript-eslint/no-useless-constructor": "error",
785
798
  "@typescript-eslint/no-useless-empty-export": "error",
786
799
  "@typescript-eslint/no-useless-template-literals": "error",
800
+ "@typescript-eslint/no-wrapper-object-types": "error",
787
801
  "@typescript-eslint/non-nullable-type-assertion-style": "error",
788
802
  "no-throw-literal": "off",
789
803
  "@typescript-eslint/only-throw-error": [
@@ -829,6 +843,8 @@ async function typescript(options) {
829
843
  "@typescript-eslint/require-await": "error",
830
844
  "@typescript-eslint/restrict-plus-operands": "error",
831
845
  "@typescript-eslint/restrict-template-expressions": "error",
846
+ "no-return-await": "off",
847
+ "@typescript-eslint/return-await": ["error", "in-try-catch"],
832
848
  "@typescript-eslint/strict-boolean-expressions": "off",
833
849
  "@typescript-eslint/switch-exhaustiveness-check": [
834
850
  "error",
package/dist/index.d.ts CHANGED
@@ -28,6 +28,8 @@ declare interface ConfigOptions {
28
28
  vitest?: boolean;
29
29
  /** @default false */
30
30
  vue?: boolean;
31
+ /** `tsconfig.json` files for Typescript. */
32
+ project: string[];
31
33
  ignores?: Ignores['ignores'];
32
34
  overrides?: {
33
35
  javascript?: Rules;
@@ -37,14 +39,20 @@ declare interface ConfigOptions {
37
39
  vitest?: Rules;
38
40
  vue?: Rules;
39
41
  };
40
- /** `tsconfig.json` files for Typescript. */
41
- project: string[];
42
+ /** @see https://typescript-eslint.io/rules/no-floating-promises#allowforknownsafepromises */
43
+ knownSafePromises?: KnownSafePromise[];
42
44
  }
43
45
 
44
46
  declare interface Ignores {
45
47
  ignores: string[];
46
48
  }
47
49
 
50
+ declare interface KnownSafePromise {
51
+ from: string;
52
+ name: string;
53
+ package?: string;
54
+ }
55
+
48
56
  declare type Rules = Record<string, Severity | any[]>;
49
57
 
50
58
  declare type Severity = 'error' | 'warn' | 'off' | 0 | 1;
package/dist/index.js CHANGED
@@ -604,7 +604,6 @@ async function typescript(options) {
604
604
  minimumDescriptionLength: 3
605
605
  }
606
606
  ],
607
- "@typescript-eslint/ban-types": "error",
608
607
  "@typescript-eslint/class-literal-property-style": ["error", "fields"],
609
608
  "class-methods-use-this": "off",
610
609
  "@typescript-eslint/class-methods-use-this": [
@@ -675,10 +674,21 @@ async function typescript(options) {
675
674
  "no-empty-function": "off",
676
675
  "@typescript-eslint/no-empty-function": "error",
677
676
  "@typescript-eslint/no-empty-interface": "error",
677
+ "@typescript-eslint/no-empty-object-type": [
678
+ "error",
679
+ { allowInterfaces: "never", allowObjectTypes: "never" }
680
+ ],
678
681
  "@typescript-eslint/no-explicit-any": ["error", { fixToUnknown: true }],
679
682
  "@typescript-eslint/no-extra-non-null-assertion": "error",
680
683
  "@typescript-eslint/no-extraneous-class": "error",
681
- "@typescript-eslint/no-floating-promises": ["error", { ignoreIIFE: true, ignoreVoid: true }],
684
+ "@typescript-eslint/no-floating-promises": [
685
+ "error",
686
+ {
687
+ ignoreIIFE: true,
688
+ ignoreVoid: true,
689
+ allowForKnownSafePromises: options.knownSafePromises ?? []
690
+ }
691
+ ],
682
692
  "@typescript-eslint/no-for-in-array": "error",
683
693
  "no-implied-eval": "off",
684
694
  "@typescript-eslint/no-implied-eval": "error",
@@ -729,14 +739,17 @@ async function typescript(options) {
729
739
  }
730
740
  ],
731
741
  "@typescript-eslint/no-unnecessary-condition": "error",
742
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": "error",
732
743
  "@typescript-eslint/no-unnecessary-qualifier": "error",
733
744
  "@typescript-eslint/no-unnecessary-type-arguments": "error",
734
745
  "@typescript-eslint/no-unnecessary-type-assertion": "error",
735
746
  "@typescript-eslint/no-unnecessary-type-constraint": "error",
747
+ "@typescript-eslint/no-unnecessary-type-parameters": "error",
736
748
  "@typescript-eslint/no-unsafe-argument": "off",
737
749
  "@typescript-eslint/no-unsafe-assignment": "off",
738
750
  "@typescript-eslint/no-unsafe-call": "error",
739
751
  "@typescript-eslint/no-unsafe-declaration-merging": "error",
752
+ "@typescript-eslint/no-unsafe-function-type": "error",
740
753
  "@typescript-eslint/no-unsafe-enum-comparison": "off",
741
754
  "@typescript-eslint/no-unsafe-member-access": "error",
742
755
  "@typescript-eslint/no-unsafe-return": "off",
@@ -761,6 +774,7 @@ async function typescript(options) {
761
774
  "@typescript-eslint/no-useless-constructor": "error",
762
775
  "@typescript-eslint/no-useless-empty-export": "error",
763
776
  "@typescript-eslint/no-useless-template-literals": "error",
777
+ "@typescript-eslint/no-wrapper-object-types": "error",
764
778
  "@typescript-eslint/non-nullable-type-assertion-style": "error",
765
779
  "no-throw-literal": "off",
766
780
  "@typescript-eslint/only-throw-error": [
@@ -806,6 +820,8 @@ async function typescript(options) {
806
820
  "@typescript-eslint/require-await": "error",
807
821
  "@typescript-eslint/restrict-plus-operands": "error",
808
822
  "@typescript-eslint/restrict-template-expressions": "error",
823
+ "no-return-await": "off",
824
+ "@typescript-eslint/return-await": ["error", "in-try-catch"],
809
825
  "@typescript-eslint/strict-boolean-expressions": "off",
810
826
  "@typescript-eslint/switch-exhaustiveness-check": [
811
827
  "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tb-dev/eslint-config",
3
- "version": "4.0.0",
3
+ "version": "4.1.1",
4
4
  "description": "ESLint config",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,8 +17,8 @@
17
17
  "*.{?(c|m)@(j|t)s,css,vue,md,json}": "prettier --write"
18
18
  },
19
19
  "dependencies": {
20
- "@typescript-eslint/eslint-plugin": "^7.16.1",
21
- "@typescript-eslint/parser": "^7.16.1",
20
+ "@typescript-eslint/eslint-plugin": "^7.17.0",
21
+ "@typescript-eslint/parser": "^7.17.0",
22
22
  "eslint-config-prettier": "^9.1.0",
23
23
  "eslint-plugin-perfectionist": "^3.0.0",
24
24
  "eslint-plugin-unicorn": "^54.0.0",