@tb-dev/eslint-config 4.4.2 → 5.0.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 +6 -52
- package/dist/index.d.ts +0 -3
- package/dist/index.js +6 -52
- package/package.json +15 -16
package/dist/index.cjs
CHANGED
|
@@ -10,7 +10,6 @@ var Glob = /* @__PURE__ */ ((Glob2) => {
|
|
|
10
10
|
Glob2["Javascript"] = "**/*.?([cm])js?(x)";
|
|
11
11
|
Glob2["Json"] = "**/*.json?([c5])";
|
|
12
12
|
Glob2["Typescript"] = "**/*.?([cm])ts?(x)";
|
|
13
|
-
Glob2["Vitest"] = "**/*.{test,spec}.[jt]s";
|
|
14
13
|
Glob2["Vue"] = "**/*.vue";
|
|
15
14
|
return Glob2;
|
|
16
15
|
})(Glob || {});
|
|
@@ -189,7 +188,7 @@ async function vue(options) {
|
|
|
189
188
|
}],
|
|
190
189
|
"vue/component-api-style": ["error", ["script-setup"]],
|
|
191
190
|
"vue/component-definition-name-casing": ["error", "PascalCase"],
|
|
192
|
-
"vue/component-name-in-template-casing": ["error", "
|
|
191
|
+
"vue/component-name-in-template-casing": ["error", "PascalCase", {
|
|
193
192
|
registeredComponentsOnly: false
|
|
194
193
|
}],
|
|
195
194
|
"vue/custom-event-name-casing": ["error", "kebab-case"],
|
|
@@ -482,49 +481,6 @@ async function jsonc(options) {
|
|
|
482
481
|
];
|
|
483
482
|
}
|
|
484
483
|
|
|
485
|
-
async function vitest(options) {
|
|
486
|
-
if (!options.features?.vitest) return {};
|
|
487
|
-
const plugin = await interopDefault(import('eslint-plugin-vitest'));
|
|
488
|
-
return {
|
|
489
|
-
plugins: { vitest: plugin },
|
|
490
|
-
files: [Glob.Vitest],
|
|
491
|
-
rules: {
|
|
492
|
-
"vitest/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
493
|
-
"vitest/expect-expect": ["error", { assertFunctionNames: ["expect"] }],
|
|
494
|
-
"vitest/max-expects": ["error", { max: 5 }],
|
|
495
|
-
"vitest/max-nested-describe": ["error", { max: 1 }],
|
|
496
|
-
"vitest/no-alias-methods": "error",
|
|
497
|
-
"vitest/no-commented-out-tests": "error",
|
|
498
|
-
"vitest/no-conditional-expect": "error",
|
|
499
|
-
"vitest/no-conditional-in-test": "error",
|
|
500
|
-
"vitest/no-conditional-tests": "error",
|
|
501
|
-
"vitest/no-done-callback": "error",
|
|
502
|
-
"vitest/no-duplicate-hooks": "error",
|
|
503
|
-
"vitest/no-identical-title": "error",
|
|
504
|
-
"vitest/no-import-node-test": "error",
|
|
505
|
-
"vitest/no-standalone-expect": "error",
|
|
506
|
-
"vitest/no-test-return-statement": "error",
|
|
507
|
-
"vitest/prefer-comparison-matcher": "error",
|
|
508
|
-
"vitest/prefer-each": "error",
|
|
509
|
-
"vitest/prefer-equality-matcher": "error",
|
|
510
|
-
"vitest/prefer-expect-resolves": "error",
|
|
511
|
-
"vitest/prefer-hooks-in-order": "error",
|
|
512
|
-
"vitest/prefer-hooks-on-top": "error",
|
|
513
|
-
"vitest/prefer-lowercase-title": "error",
|
|
514
|
-
"vitest/prefer-mock-promise-shorthand": "error",
|
|
515
|
-
"vitest/prefer-spy-on": "error",
|
|
516
|
-
"vitest/prefer-to-be-object": "error",
|
|
517
|
-
"vitest/prefer-to-contain": "error",
|
|
518
|
-
"vitest/prefer-to-have-length": "error",
|
|
519
|
-
"vitest/prefer-todo": "error",
|
|
520
|
-
"vitest/require-top-level-describe": ["error", { maxNumberOfTopLevelDescribes: 10 }],
|
|
521
|
-
"vitest/valid-describe-callback": "error",
|
|
522
|
-
"vitest/valid-expect": "error",
|
|
523
|
-
...options.overrides?.vitest
|
|
524
|
-
}
|
|
525
|
-
};
|
|
526
|
-
}
|
|
527
|
-
|
|
528
484
|
async function unicorn(options) {
|
|
529
485
|
const { unicorn: enabled = true } = options.features ?? {};
|
|
530
486
|
if (!enabled) return {};
|
|
@@ -544,6 +500,7 @@ async function unicorn(options) {
|
|
|
544
500
|
"unicorn/no-await-in-promise-methods": "error",
|
|
545
501
|
"unicorn/no-invalid-fetch-options": "error",
|
|
546
502
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
503
|
+
"unicorn/no-length-as-slice-end": "error",
|
|
547
504
|
"unicorn/no-magic-array-flat-depth": "error",
|
|
548
505
|
"unicorn/no-negation-in-equality-check": "error",
|
|
549
506
|
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
@@ -663,6 +620,7 @@ function javascript(options) {
|
|
|
663
620
|
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
|
664
621
|
"no-lone-blocks": "error",
|
|
665
622
|
"no-lonely-if": "error",
|
|
623
|
+
"no-loss-of-precision": "error",
|
|
666
624
|
"no-misleading-character-class": "error",
|
|
667
625
|
"no-multi-assign": "error",
|
|
668
626
|
"no-multi-str": "error",
|
|
@@ -814,7 +772,6 @@ async function typescript(options) {
|
|
|
814
772
|
"@typescript-eslint/no-dynamic-delete": "error",
|
|
815
773
|
"no-empty-function": "off",
|
|
816
774
|
"@typescript-eslint/no-empty-function": "error",
|
|
817
|
-
"@typescript-eslint/no-empty-interface": "error",
|
|
818
775
|
"@typescript-eslint/no-empty-object-type": ["error", {
|
|
819
776
|
allowInterfaces: "never",
|
|
820
777
|
allowObjectTypes: "never"
|
|
@@ -823,9 +780,10 @@ async function typescript(options) {
|
|
|
823
780
|
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
824
781
|
"@typescript-eslint/no-extraneous-class": "error",
|
|
825
782
|
"@typescript-eslint/no-floating-promises": ["error", {
|
|
783
|
+
allowForKnownSafePromises: options.knownSafePromises ?? [],
|
|
784
|
+
checkThenables: false,
|
|
826
785
|
ignoreIIFE: true,
|
|
827
|
-
ignoreVoid: true
|
|
828
|
-
allowForKnownSafePromises: options.knownSafePromises ?? []
|
|
786
|
+
ignoreVoid: true
|
|
829
787
|
}],
|
|
830
788
|
"@typescript-eslint/no-for-in-array": "error",
|
|
831
789
|
"no-implied-eval": "off",
|
|
@@ -838,8 +796,6 @@ async function typescript(options) {
|
|
|
838
796
|
}],
|
|
839
797
|
"no-loop-func": "off",
|
|
840
798
|
"@typescript-eslint/no-loop-func": "error",
|
|
841
|
-
"no-loss-of-precision": "off",
|
|
842
|
-
"@typescript-eslint/no-loss-of-precision": "error",
|
|
843
799
|
"@typescript-eslint/no-meaningless-void-operator": "error",
|
|
844
800
|
"@typescript-eslint/no-misused-new": "error",
|
|
845
801
|
"@typescript-eslint/no-misused-promises": ["error", {
|
|
@@ -894,7 +850,6 @@ async function typescript(options) {
|
|
|
894
850
|
"no-useless-constructor": "off",
|
|
895
851
|
"@typescript-eslint/no-useless-constructor": "error",
|
|
896
852
|
"@typescript-eslint/no-useless-empty-export": "error",
|
|
897
|
-
"@typescript-eslint/no-useless-template-literals": "error",
|
|
898
853
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
899
854
|
"@typescript-eslint/non-nullable-type-assertion-style": "error",
|
|
900
855
|
"no-throw-literal": "off",
|
|
@@ -1040,7 +995,6 @@ async function defineConfig(options) {
|
|
|
1040
995
|
stylistic(options),
|
|
1041
996
|
perfectionist(options),
|
|
1042
997
|
unicorn(options),
|
|
1043
|
-
vitest(options),
|
|
1044
998
|
tailwind(options),
|
|
1045
999
|
ignores
|
|
1046
1000
|
]);
|
package/dist/index.d.ts
CHANGED
|
@@ -27,8 +27,6 @@ declare interface ConfigOptions {
|
|
|
27
27
|
/** @default true */
|
|
28
28
|
unicorn?: boolean;
|
|
29
29
|
/** @default false */
|
|
30
|
-
vitest?: boolean;
|
|
31
|
-
/** @default false */
|
|
32
30
|
vue?: boolean;
|
|
33
31
|
};
|
|
34
32
|
/** `tsconfig.json` files for TypeScript. */
|
|
@@ -42,7 +40,6 @@ declare interface ConfigOptions {
|
|
|
42
40
|
tailwind?: Rules;
|
|
43
41
|
typescript?: Rules;
|
|
44
42
|
unicorn?: Rules;
|
|
45
|
-
vitest?: Rules;
|
|
46
43
|
vue?: Rules;
|
|
47
44
|
};
|
|
48
45
|
/** @see https://typescript-eslint.io/rules/no-floating-promises#allowforknownsafepromises */
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ var Glob = /* @__PURE__ */ ((Glob2) => {
|
|
|
6
6
|
Glob2["Javascript"] = "**/*.?([cm])js?(x)";
|
|
7
7
|
Glob2["Json"] = "**/*.json?([c5])";
|
|
8
8
|
Glob2["Typescript"] = "**/*.?([cm])ts?(x)";
|
|
9
|
-
Glob2["Vitest"] = "**/*.{test,spec}.[jt]s";
|
|
10
9
|
Glob2["Vue"] = "**/*.vue";
|
|
11
10
|
return Glob2;
|
|
12
11
|
})(Glob || {});
|
|
@@ -185,7 +184,7 @@ async function vue(options) {
|
|
|
185
184
|
}],
|
|
186
185
|
"vue/component-api-style": ["error", ["script-setup"]],
|
|
187
186
|
"vue/component-definition-name-casing": ["error", "PascalCase"],
|
|
188
|
-
"vue/component-name-in-template-casing": ["error", "
|
|
187
|
+
"vue/component-name-in-template-casing": ["error", "PascalCase", {
|
|
189
188
|
registeredComponentsOnly: false
|
|
190
189
|
}],
|
|
191
190
|
"vue/custom-event-name-casing": ["error", "kebab-case"],
|
|
@@ -478,49 +477,6 @@ async function jsonc(options) {
|
|
|
478
477
|
];
|
|
479
478
|
}
|
|
480
479
|
|
|
481
|
-
async function vitest(options) {
|
|
482
|
-
if (!options.features?.vitest) return {};
|
|
483
|
-
const plugin = await interopDefault(import('eslint-plugin-vitest'));
|
|
484
|
-
return {
|
|
485
|
-
plugins: { vitest: plugin },
|
|
486
|
-
files: [Glob.Vitest],
|
|
487
|
-
rules: {
|
|
488
|
-
"vitest/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
489
|
-
"vitest/expect-expect": ["error", { assertFunctionNames: ["expect"] }],
|
|
490
|
-
"vitest/max-expects": ["error", { max: 5 }],
|
|
491
|
-
"vitest/max-nested-describe": ["error", { max: 1 }],
|
|
492
|
-
"vitest/no-alias-methods": "error",
|
|
493
|
-
"vitest/no-commented-out-tests": "error",
|
|
494
|
-
"vitest/no-conditional-expect": "error",
|
|
495
|
-
"vitest/no-conditional-in-test": "error",
|
|
496
|
-
"vitest/no-conditional-tests": "error",
|
|
497
|
-
"vitest/no-done-callback": "error",
|
|
498
|
-
"vitest/no-duplicate-hooks": "error",
|
|
499
|
-
"vitest/no-identical-title": "error",
|
|
500
|
-
"vitest/no-import-node-test": "error",
|
|
501
|
-
"vitest/no-standalone-expect": "error",
|
|
502
|
-
"vitest/no-test-return-statement": "error",
|
|
503
|
-
"vitest/prefer-comparison-matcher": "error",
|
|
504
|
-
"vitest/prefer-each": "error",
|
|
505
|
-
"vitest/prefer-equality-matcher": "error",
|
|
506
|
-
"vitest/prefer-expect-resolves": "error",
|
|
507
|
-
"vitest/prefer-hooks-in-order": "error",
|
|
508
|
-
"vitest/prefer-hooks-on-top": "error",
|
|
509
|
-
"vitest/prefer-lowercase-title": "error",
|
|
510
|
-
"vitest/prefer-mock-promise-shorthand": "error",
|
|
511
|
-
"vitest/prefer-spy-on": "error",
|
|
512
|
-
"vitest/prefer-to-be-object": "error",
|
|
513
|
-
"vitest/prefer-to-contain": "error",
|
|
514
|
-
"vitest/prefer-to-have-length": "error",
|
|
515
|
-
"vitest/prefer-todo": "error",
|
|
516
|
-
"vitest/require-top-level-describe": ["error", { maxNumberOfTopLevelDescribes: 10 }],
|
|
517
|
-
"vitest/valid-describe-callback": "error",
|
|
518
|
-
"vitest/valid-expect": "error",
|
|
519
|
-
...options.overrides?.vitest
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
|
|
524
480
|
async function unicorn(options) {
|
|
525
481
|
const { unicorn: enabled = true } = options.features ?? {};
|
|
526
482
|
if (!enabled) return {};
|
|
@@ -540,6 +496,7 @@ async function unicorn(options) {
|
|
|
540
496
|
"unicorn/no-await-in-promise-methods": "error",
|
|
541
497
|
"unicorn/no-invalid-fetch-options": "error",
|
|
542
498
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
499
|
+
"unicorn/no-length-as-slice-end": "error",
|
|
543
500
|
"unicorn/no-magic-array-flat-depth": "error",
|
|
544
501
|
"unicorn/no-negation-in-equality-check": "error",
|
|
545
502
|
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
@@ -659,6 +616,7 @@ function javascript(options) {
|
|
|
659
616
|
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
|
660
617
|
"no-lone-blocks": "error",
|
|
661
618
|
"no-lonely-if": "error",
|
|
619
|
+
"no-loss-of-precision": "error",
|
|
662
620
|
"no-misleading-character-class": "error",
|
|
663
621
|
"no-multi-assign": "error",
|
|
664
622
|
"no-multi-str": "error",
|
|
@@ -810,7 +768,6 @@ async function typescript(options) {
|
|
|
810
768
|
"@typescript-eslint/no-dynamic-delete": "error",
|
|
811
769
|
"no-empty-function": "off",
|
|
812
770
|
"@typescript-eslint/no-empty-function": "error",
|
|
813
|
-
"@typescript-eslint/no-empty-interface": "error",
|
|
814
771
|
"@typescript-eslint/no-empty-object-type": ["error", {
|
|
815
772
|
allowInterfaces: "never",
|
|
816
773
|
allowObjectTypes: "never"
|
|
@@ -819,9 +776,10 @@ async function typescript(options) {
|
|
|
819
776
|
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
820
777
|
"@typescript-eslint/no-extraneous-class": "error",
|
|
821
778
|
"@typescript-eslint/no-floating-promises": ["error", {
|
|
779
|
+
allowForKnownSafePromises: options.knownSafePromises ?? [],
|
|
780
|
+
checkThenables: false,
|
|
822
781
|
ignoreIIFE: true,
|
|
823
|
-
ignoreVoid: true
|
|
824
|
-
allowForKnownSafePromises: options.knownSafePromises ?? []
|
|
782
|
+
ignoreVoid: true
|
|
825
783
|
}],
|
|
826
784
|
"@typescript-eslint/no-for-in-array": "error",
|
|
827
785
|
"no-implied-eval": "off",
|
|
@@ -834,8 +792,6 @@ async function typescript(options) {
|
|
|
834
792
|
}],
|
|
835
793
|
"no-loop-func": "off",
|
|
836
794
|
"@typescript-eslint/no-loop-func": "error",
|
|
837
|
-
"no-loss-of-precision": "off",
|
|
838
|
-
"@typescript-eslint/no-loss-of-precision": "error",
|
|
839
795
|
"@typescript-eslint/no-meaningless-void-operator": "error",
|
|
840
796
|
"@typescript-eslint/no-misused-new": "error",
|
|
841
797
|
"@typescript-eslint/no-misused-promises": ["error", {
|
|
@@ -890,7 +846,6 @@ async function typescript(options) {
|
|
|
890
846
|
"no-useless-constructor": "off",
|
|
891
847
|
"@typescript-eslint/no-useless-constructor": "error",
|
|
892
848
|
"@typescript-eslint/no-useless-empty-export": "error",
|
|
893
|
-
"@typescript-eslint/no-useless-template-literals": "error",
|
|
894
849
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
895
850
|
"@typescript-eslint/non-nullable-type-assertion-style": "error",
|
|
896
851
|
"no-throw-literal": "off",
|
|
@@ -1036,7 +991,6 @@ async function defineConfig(options) {
|
|
|
1036
991
|
stylistic(options),
|
|
1037
992
|
perfectionist(options),
|
|
1038
993
|
unicorn(options),
|
|
1039
|
-
vitest(options),
|
|
1040
994
|
tailwind(options),
|
|
1041
995
|
ignores
|
|
1042
996
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tb-dev/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "ESLint config",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,32 +24,31 @@
|
|
|
24
24
|
"*.{?(c|m)@(j|t)s,css,vue,md,json}": "eslint --config eslint.config.js --fix"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@stylistic/eslint-plugin": "^2.
|
|
28
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
29
|
-
"@typescript-eslint/parser": "^
|
|
27
|
+
"@stylistic/eslint-plugin": "^2.6.1",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
|
29
|
+
"@typescript-eslint/parser": "^8.0.1",
|
|
30
30
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
31
|
-
"eslint-plugin-perfectionist": "^3.
|
|
31
|
+
"eslint-plugin-perfectionist": "^3.1.2",
|
|
32
32
|
"eslint-plugin-tailwindcss": "^3.17.4",
|
|
33
|
-
"eslint-plugin-unicorn": "^
|
|
34
|
-
"eslint-plugin-vitest": "^0.5.4",
|
|
33
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
35
34
|
"eslint-plugin-vue": "^9.27.0",
|
|
36
|
-
"globals": "^15.
|
|
35
|
+
"globals": "^15.9.0",
|
|
37
36
|
"vue-eslint-parser": "^9.4.3"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
|
-
"@types/node": "^
|
|
41
|
-
"eslint": "^8.
|
|
42
|
-
"husky": "^9.1.
|
|
43
|
-
"lint-staged": "^15.2.
|
|
39
|
+
"@types/node": "^22.1.0",
|
|
40
|
+
"eslint": "^9.8.0",
|
|
41
|
+
"husky": "^9.1.4",
|
|
42
|
+
"lint-staged": "^15.2.8",
|
|
44
43
|
"prettier": "^3.3.3",
|
|
45
44
|
"tslib": "^2.6.3",
|
|
46
45
|
"typescript": "^5.5.4",
|
|
47
|
-
"vite": "^5.3.
|
|
48
|
-
"vite-plugin-dts": "
|
|
46
|
+
"vite": "^5.3.5",
|
|
47
|
+
"vite-plugin-dts": "3.9.1"
|
|
49
48
|
},
|
|
50
49
|
"peerDependencies": {
|
|
51
|
-
"eslint": "^8.
|
|
52
|
-
"typescript": "^5.
|
|
50
|
+
"eslint": "^9.8.0",
|
|
51
|
+
"typescript": "^5.5.0"
|
|
53
52
|
},
|
|
54
53
|
"engines": {
|
|
55
54
|
"node": ">=22"
|