@tb-dev/eslint-config 4.0.0 → 4.1.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 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,17 @@ 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
+ { ignoreIIFE: true, ignoreVoid: true, allowForKnownSafePromises: options.knownSafePromises }
710
+ ],
705
711
  "@typescript-eslint/no-for-in-array": "error",
706
712
  "no-implied-eval": "off",
707
713
  "@typescript-eslint/no-implied-eval": "error",
@@ -752,14 +758,17 @@ async function typescript(options) {
752
758
  }
753
759
  ],
754
760
  "@typescript-eslint/no-unnecessary-condition": "error",
761
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": "error",
755
762
  "@typescript-eslint/no-unnecessary-qualifier": "error",
756
763
  "@typescript-eslint/no-unnecessary-type-arguments": "error",
757
764
  "@typescript-eslint/no-unnecessary-type-assertion": "error",
758
765
  "@typescript-eslint/no-unnecessary-type-constraint": "error",
766
+ "@typescript-eslint/no-unnecessary-type-parameters": "error",
759
767
  "@typescript-eslint/no-unsafe-argument": "off",
760
768
  "@typescript-eslint/no-unsafe-assignment": "off",
761
769
  "@typescript-eslint/no-unsafe-call": "error",
762
770
  "@typescript-eslint/no-unsafe-declaration-merging": "error",
771
+ "@typescript-eslint/no-unsafe-function-type": "error",
763
772
  "@typescript-eslint/no-unsafe-enum-comparison": "off",
764
773
  "@typescript-eslint/no-unsafe-member-access": "error",
765
774
  "@typescript-eslint/no-unsafe-return": "off",
@@ -784,6 +793,7 @@ async function typescript(options) {
784
793
  "@typescript-eslint/no-useless-constructor": "error",
785
794
  "@typescript-eslint/no-useless-empty-export": "error",
786
795
  "@typescript-eslint/no-useless-template-literals": "error",
796
+ "@typescript-eslint/no-wrapper-object-types": "error",
787
797
  "@typescript-eslint/non-nullable-type-assertion-style": "error",
788
798
  "no-throw-literal": "off",
789
799
  "@typescript-eslint/only-throw-error": [
@@ -829,6 +839,8 @@ async function typescript(options) {
829
839
  "@typescript-eslint/require-await": "error",
830
840
  "@typescript-eslint/restrict-plus-operands": "error",
831
841
  "@typescript-eslint/restrict-template-expressions": "error",
842
+ "no-return-await": "off",
843
+ "@typescript-eslint/return-await": ["error", "in-try-catch"],
832
844
  "@typescript-eslint/strict-boolean-expressions": "off",
833
845
  "@typescript-eslint/switch-exhaustiveness-check": [
834
846
  "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,17 @@ 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
+ { ignoreIIFE: true, ignoreVoid: true, allowForKnownSafePromises: options.knownSafePromises }
687
+ ],
682
688
  "@typescript-eslint/no-for-in-array": "error",
683
689
  "no-implied-eval": "off",
684
690
  "@typescript-eslint/no-implied-eval": "error",
@@ -729,14 +735,17 @@ async function typescript(options) {
729
735
  }
730
736
  ],
731
737
  "@typescript-eslint/no-unnecessary-condition": "error",
738
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": "error",
732
739
  "@typescript-eslint/no-unnecessary-qualifier": "error",
733
740
  "@typescript-eslint/no-unnecessary-type-arguments": "error",
734
741
  "@typescript-eslint/no-unnecessary-type-assertion": "error",
735
742
  "@typescript-eslint/no-unnecessary-type-constraint": "error",
743
+ "@typescript-eslint/no-unnecessary-type-parameters": "error",
736
744
  "@typescript-eslint/no-unsafe-argument": "off",
737
745
  "@typescript-eslint/no-unsafe-assignment": "off",
738
746
  "@typescript-eslint/no-unsafe-call": "error",
739
747
  "@typescript-eslint/no-unsafe-declaration-merging": "error",
748
+ "@typescript-eslint/no-unsafe-function-type": "error",
740
749
  "@typescript-eslint/no-unsafe-enum-comparison": "off",
741
750
  "@typescript-eslint/no-unsafe-member-access": "error",
742
751
  "@typescript-eslint/no-unsafe-return": "off",
@@ -761,6 +770,7 @@ async function typescript(options) {
761
770
  "@typescript-eslint/no-useless-constructor": "error",
762
771
  "@typescript-eslint/no-useless-empty-export": "error",
763
772
  "@typescript-eslint/no-useless-template-literals": "error",
773
+ "@typescript-eslint/no-wrapper-object-types": "error",
764
774
  "@typescript-eslint/non-nullable-type-assertion-style": "error",
765
775
  "no-throw-literal": "off",
766
776
  "@typescript-eslint/only-throw-error": [
@@ -806,6 +816,8 @@ async function typescript(options) {
806
816
  "@typescript-eslint/require-await": "error",
807
817
  "@typescript-eslint/restrict-plus-operands": "error",
808
818
  "@typescript-eslint/restrict-template-expressions": "error",
819
+ "no-return-await": "off",
820
+ "@typescript-eslint/return-await": ["error", "in-try-catch"],
809
821
  "@typescript-eslint/strict-boolean-expressions": "off",
810
822
  "@typescript-eslint/switch-exhaustiveness-check": [
811
823
  "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.0",
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",