@jsse/eslint-config 0.0.7 → 0.0.8
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/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +35 -50
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +34 -50
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2368,6 +2368,7 @@ __export(src_exports, {
|
|
|
2368
2368
|
node: () => node,
|
|
2369
2369
|
parserJsonc: () => import_jsonc_eslint_parser.default,
|
|
2370
2370
|
parserTs: () => parserTs,
|
|
2371
|
+
pluginAntfu: () => import_eslint_plugin_antfu.default,
|
|
2371
2372
|
pluginEslintComments: () => import_eslint_plugin_eslint_comments.default,
|
|
2372
2373
|
pluginImport: () => pluginImport,
|
|
2373
2374
|
pluginJsdoc: () => import_eslint_plugin_jsdoc.default,
|
|
@@ -2418,6 +2419,7 @@ var import_eslint_plugin_tailwindcss = __toESM(require("eslint-plugin-tailwindcs
|
|
|
2418
2419
|
var import_eslint_plugin_vitest = __toESM(require("eslint-plugin-vitest"), 1);
|
|
2419
2420
|
var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
|
|
2420
2421
|
var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
|
|
2422
|
+
var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
|
|
2421
2423
|
|
|
2422
2424
|
// src/configs/comments.ts
|
|
2423
2425
|
function comments() {
|
|
@@ -2727,7 +2729,6 @@ function javascript(options = {}) {
|
|
|
2727
2729
|
"no-useless-rename": "error",
|
|
2728
2730
|
"no-useless-return": "error",
|
|
2729
2731
|
"no-var": "error",
|
|
2730
|
-
"no-void": "error",
|
|
2731
2732
|
"no-with": "error",
|
|
2732
2733
|
"object-shorthand": [
|
|
2733
2734
|
"error",
|
|
@@ -3058,42 +3059,26 @@ function prettier() {
|
|
|
3058
3059
|
|
|
3059
3060
|
// src/configs/ts/typescript-language-options.ts
|
|
3060
3061
|
var import_node_process = __toESM(require("process"), 1);
|
|
3061
|
-
function parserOptionProject(tsconfigPath) {
|
|
3062
|
-
if (typeof tsconfigPath === "string") {
|
|
3063
|
-
return [tsconfigPath];
|
|
3064
|
-
}
|
|
3065
|
-
return tsconfigPath;
|
|
3066
|
-
}
|
|
3067
3062
|
function typescriptLanguageOptions(options) {
|
|
3068
|
-
const {
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
project: parserOptionProject(tsconfig),
|
|
3079
|
-
tsconfigRootDir: import_node_process.default.cwd()
|
|
3080
|
-
} : {},
|
|
3081
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3082
|
-
...parserOptions
|
|
3083
|
-
}
|
|
3084
|
-
};
|
|
3085
|
-
}
|
|
3063
|
+
const {
|
|
3064
|
+
parserOptions = {},
|
|
3065
|
+
tsconfig,
|
|
3066
|
+
react: react2,
|
|
3067
|
+
componentExts = []
|
|
3068
|
+
} = options || {};
|
|
3069
|
+
const tsOptions = tsconfig ? {
|
|
3070
|
+
project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
3071
|
+
tsconfigRootDir: import_node_process.default.cwd()
|
|
3072
|
+
} : {};
|
|
3086
3073
|
return {
|
|
3087
3074
|
parser: parserTs,
|
|
3088
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
3089
3075
|
parserOptions: {
|
|
3076
|
+
ecmaFeatures: react2 ? { jsx: true, modules: true } : void 0,
|
|
3077
|
+
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
3090
3078
|
sourceType: "module",
|
|
3091
|
-
...
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
} : {},
|
|
3095
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3096
|
-
...parserOptions
|
|
3079
|
+
...tsOptions,
|
|
3080
|
+
...parserOptions,
|
|
3081
|
+
jsxPragma: react2 ? "React" : void 0
|
|
3097
3082
|
}
|
|
3098
3083
|
};
|
|
3099
3084
|
}
|
|
@@ -3330,11 +3315,18 @@ function reactRecomendedRules() {
|
|
|
3330
3315
|
};
|
|
3331
3316
|
}
|
|
3332
3317
|
function react(options) {
|
|
3333
|
-
const {
|
|
3318
|
+
const {
|
|
3319
|
+
parserOptions = {},
|
|
3320
|
+
tsconfig,
|
|
3321
|
+
react: react2,
|
|
3322
|
+
reactRefresh,
|
|
3323
|
+
componentExts
|
|
3324
|
+
} = options ?? {};
|
|
3334
3325
|
const config = [
|
|
3335
3326
|
{
|
|
3336
3327
|
files: [GLOB_SRC],
|
|
3337
3328
|
languageOptions: typescriptLanguageOptions({
|
|
3329
|
+
componentExts,
|
|
3338
3330
|
parserOptions,
|
|
3339
3331
|
react: react2,
|
|
3340
3332
|
tsconfig
|
|
@@ -3614,31 +3606,23 @@ function test(options = {}) {
|
|
|
3614
3606
|
{
|
|
3615
3607
|
name: "jsse:test:setup",
|
|
3616
3608
|
plugins: {
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
3620
|
-
rules: {
|
|
3621
|
-
...import_eslint_plugin_vitest.default.rules,
|
|
3622
|
-
// extend `test/no-only-tests` rule
|
|
3623
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3624
|
-
...import_eslint_plugin_no_only_tests.default.rules
|
|
3625
|
-
}
|
|
3626
|
-
}
|
|
3609
|
+
"no-only-tests": import_eslint_plugin_no_only_tests.default,
|
|
3610
|
+
vitest: import_eslint_plugin_vitest.default
|
|
3627
3611
|
}
|
|
3628
3612
|
},
|
|
3629
3613
|
{
|
|
3630
3614
|
files: GLOB_TESTS,
|
|
3631
3615
|
name: "jsse:test:rules",
|
|
3632
3616
|
rules: {
|
|
3633
|
-
"
|
|
3617
|
+
"no-only-tests/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
|
|
3618
|
+
"unicorn/no-null": "off",
|
|
3619
|
+
"vitest/consistent-test-it": [
|
|
3634
3620
|
"error",
|
|
3635
|
-
{ fn: "
|
|
3621
|
+
{ fn: "test", withinDescribe: "test" }
|
|
3636
3622
|
],
|
|
3637
|
-
"
|
|
3638
|
-
"
|
|
3639
|
-
"
|
|
3640
|
-
"test/prefer-lowercase-title": "error",
|
|
3641
|
-
"unicorn/no-null": "off",
|
|
3623
|
+
"vitest/no-identical-title": "error",
|
|
3624
|
+
"vitest/prefer-hooks-in-order": "error",
|
|
3625
|
+
"vitest/prefer-lowercase-title": "error",
|
|
3642
3626
|
...overrides
|
|
3643
3627
|
}
|
|
3644
3628
|
}
|
|
@@ -11345,6 +11329,7 @@ function jsseReact() {
|
|
|
11345
11329
|
node,
|
|
11346
11330
|
parserJsonc,
|
|
11347
11331
|
parserTs,
|
|
11332
|
+
pluginAntfu,
|
|
11348
11333
|
pluginEslintComments,
|
|
11349
11334
|
pluginImport,
|
|
11350
11335
|
pluginJsdoc,
|
package/dist/index.d.cts
CHANGED
|
@@ -25,6 +25,7 @@ export { default as pluginTailwind } from 'eslint-plugin-tailwindcss';
|
|
|
25
25
|
export { default as pluginVitest } from 'eslint-plugin-vitest';
|
|
26
26
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
27
27
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
28
|
+
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
28
29
|
|
|
29
30
|
type Rules = MergeIntersection<RenamePrefix<TypeScriptRules, "@typescript-eslint/", "ts/"> & RenamePrefix<VitestRules, "vitest/", "test/"> & RenamePrefix<YmlRules, "yml/", "yaml/"> & RenamePrefix<NRules, "n/", "node/"> & ImportRules & EslintRules & JsoncRules & VueRules & UnicornRules & EslintCommentsRules & {
|
|
30
31
|
"test/no-only-tests": RuleConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { default as pluginTailwind } from 'eslint-plugin-tailwindcss';
|
|
|
25
25
|
export { default as pluginVitest } from 'eslint-plugin-vitest';
|
|
26
26
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
27
27
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
28
|
+
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
28
29
|
|
|
29
30
|
type Rules = MergeIntersection<RenamePrefix<TypeScriptRules, "@typescript-eslint/", "ts/"> & RenamePrefix<VitestRules, "vitest/", "test/"> & RenamePrefix<YmlRules, "yml/", "yaml/"> & RenamePrefix<NRules, "n/", "node/"> & ImportRules & EslintRules & JsoncRules & VueRules & UnicornRules & EslintCommentsRules & {
|
|
30
31
|
"test/no-only-tests": RuleConfig;
|
package/dist/index.js
CHANGED
|
@@ -2342,6 +2342,7 @@ import { default as default12 } from "eslint-plugin-tailwindcss";
|
|
|
2342
2342
|
import { default as default13 } from "eslint-plugin-vitest";
|
|
2343
2343
|
import { default as default14 } from "jsonc-eslint-parser";
|
|
2344
2344
|
import { default as default15 } from "eslint-plugin-markdown";
|
|
2345
|
+
import { default as default16 } from "eslint-plugin-antfu";
|
|
2345
2346
|
|
|
2346
2347
|
// src/configs/comments.ts
|
|
2347
2348
|
function comments() {
|
|
@@ -2651,7 +2652,6 @@ function javascript(options = {}) {
|
|
|
2651
2652
|
"no-useless-rename": "error",
|
|
2652
2653
|
"no-useless-return": "error",
|
|
2653
2654
|
"no-var": "error",
|
|
2654
|
-
"no-void": "error",
|
|
2655
2655
|
"no-with": "error",
|
|
2656
2656
|
"object-shorthand": [
|
|
2657
2657
|
"error",
|
|
@@ -2982,42 +2982,26 @@ function prettier() {
|
|
|
2982
2982
|
|
|
2983
2983
|
// src/configs/ts/typescript-language-options.ts
|
|
2984
2984
|
import process2 from "process";
|
|
2985
|
-
function parserOptionProject(tsconfigPath) {
|
|
2986
|
-
if (typeof tsconfigPath === "string") {
|
|
2987
|
-
return [tsconfigPath];
|
|
2988
|
-
}
|
|
2989
|
-
return tsconfigPath;
|
|
2990
|
-
}
|
|
2991
2985
|
function typescriptLanguageOptions(options) {
|
|
2992
|
-
const {
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
project: parserOptionProject(tsconfig),
|
|
3003
|
-
tsconfigRootDir: process2.cwd()
|
|
3004
|
-
} : {},
|
|
3005
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3006
|
-
...parserOptions
|
|
3007
|
-
}
|
|
3008
|
-
};
|
|
3009
|
-
}
|
|
2986
|
+
const {
|
|
2987
|
+
parserOptions = {},
|
|
2988
|
+
tsconfig,
|
|
2989
|
+
react: react2,
|
|
2990
|
+
componentExts = []
|
|
2991
|
+
} = options || {};
|
|
2992
|
+
const tsOptions = tsconfig ? {
|
|
2993
|
+
project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
2994
|
+
tsconfigRootDir: process2.cwd()
|
|
2995
|
+
} : {};
|
|
3010
2996
|
return {
|
|
3011
2997
|
parser: parserTs,
|
|
3012
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
3013
2998
|
parserOptions: {
|
|
2999
|
+
ecmaFeatures: react2 ? { jsx: true, modules: true } : void 0,
|
|
3000
|
+
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
3014
3001
|
sourceType: "module",
|
|
3015
|
-
...
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
} : {},
|
|
3019
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3020
|
-
...parserOptions
|
|
3002
|
+
...tsOptions,
|
|
3003
|
+
...parserOptions,
|
|
3004
|
+
jsxPragma: react2 ? "React" : void 0
|
|
3021
3005
|
}
|
|
3022
3006
|
};
|
|
3023
3007
|
}
|
|
@@ -3254,11 +3238,18 @@ function reactRecomendedRules() {
|
|
|
3254
3238
|
};
|
|
3255
3239
|
}
|
|
3256
3240
|
function react(options) {
|
|
3257
|
-
const {
|
|
3241
|
+
const {
|
|
3242
|
+
parserOptions = {},
|
|
3243
|
+
tsconfig,
|
|
3244
|
+
react: react2,
|
|
3245
|
+
reactRefresh,
|
|
3246
|
+
componentExts
|
|
3247
|
+
} = options ?? {};
|
|
3258
3248
|
const config = [
|
|
3259
3249
|
{
|
|
3260
3250
|
files: [GLOB_SRC],
|
|
3261
3251
|
languageOptions: typescriptLanguageOptions({
|
|
3252
|
+
componentExts,
|
|
3262
3253
|
parserOptions,
|
|
3263
3254
|
react: react2,
|
|
3264
3255
|
tsconfig
|
|
@@ -3538,31 +3529,23 @@ function test(options = {}) {
|
|
|
3538
3529
|
{
|
|
3539
3530
|
name: "jsse:test:setup",
|
|
3540
3531
|
plugins: {
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
3544
|
-
rules: {
|
|
3545
|
-
...default13.rules,
|
|
3546
|
-
// extend `test/no-only-tests` rule
|
|
3547
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3548
|
-
...default7.rules
|
|
3549
|
-
}
|
|
3550
|
-
}
|
|
3532
|
+
"no-only-tests": default7,
|
|
3533
|
+
vitest: default13
|
|
3551
3534
|
}
|
|
3552
3535
|
},
|
|
3553
3536
|
{
|
|
3554
3537
|
files: GLOB_TESTS,
|
|
3555
3538
|
name: "jsse:test:rules",
|
|
3556
3539
|
rules: {
|
|
3557
|
-
"
|
|
3540
|
+
"no-only-tests/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
|
|
3541
|
+
"unicorn/no-null": "off",
|
|
3542
|
+
"vitest/consistent-test-it": [
|
|
3558
3543
|
"error",
|
|
3559
|
-
{ fn: "
|
|
3544
|
+
{ fn: "test", withinDescribe: "test" }
|
|
3560
3545
|
],
|
|
3561
|
-
"
|
|
3562
|
-
"
|
|
3563
|
-
"
|
|
3564
|
-
"test/prefer-lowercase-title": "error",
|
|
3565
|
-
"unicorn/no-null": "off",
|
|
3546
|
+
"vitest/no-identical-title": "error",
|
|
3547
|
+
"vitest/prefer-hooks-in-order": "error",
|
|
3548
|
+
"vitest/prefer-lowercase-title": "error",
|
|
3566
3549
|
...overrides
|
|
3567
3550
|
}
|
|
3568
3551
|
}
|
|
@@ -11266,6 +11249,7 @@ export {
|
|
|
11266
11249
|
node,
|
|
11267
11250
|
default14 as parserJsonc,
|
|
11268
11251
|
parserTs,
|
|
11252
|
+
default16 as pluginAntfu,
|
|
11269
11253
|
default4 as pluginEslintComments,
|
|
11270
11254
|
pluginImport,
|
|
11271
11255
|
default5 as pluginJsdoc,
|
package/package.json
CHANGED