@ntnyq/eslint-config 3.12.0 → 3.12.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 +51 -52
- package/dist/index.d.cts +5 -16
- package/dist/index.d.ts +5 -16
- package/dist/index.js +52 -53
- package/package.json +9 -7
package/dist/index.cjs
CHANGED
|
@@ -773,7 +773,7 @@ async function ensurePackages(packages) {
|
|
|
773
773
|
if (import_node_process3.default.env.CI || !import_node_process3.default.stdout.isTTY || isInGitHooksOrRunByNanoStagedOrRunByTSX() || !isCwdInScope) {
|
|
774
774
|
return;
|
|
775
775
|
}
|
|
776
|
-
const nonExistingPackages = packages.filter((pkg) => !!pkg && isPackageInScope(pkg));
|
|
776
|
+
const nonExistingPackages = packages.filter((pkg) => !!pkg && !isPackageInScope(pkg));
|
|
777
777
|
if (nonExistingPackages.length === 0) {
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
@@ -1264,12 +1264,19 @@ var vitest = (options = {}) => {
|
|
|
1264
1264
|
|
|
1265
1265
|
// src/configs/svgo.ts
|
|
1266
1266
|
var import_eslint_plugin_svgo2 = require("eslint-plugin-svgo");
|
|
1267
|
-
var svgo = (options = {}) =>
|
|
1268
|
-
{
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1267
|
+
var svgo = (options = {}) => {
|
|
1268
|
+
const { files = [GLOB_SVG], rules: overridesRules = {} } = options;
|
|
1269
|
+
return [
|
|
1270
|
+
(0, import_eslint_plugin_svgo2.createConfig)({
|
|
1271
|
+
name: "ntnyq/svgo",
|
|
1272
|
+
files,
|
|
1273
|
+
rules: {
|
|
1274
|
+
"svgo/svgo": "error",
|
|
1275
|
+
...overridesRules
|
|
1276
|
+
}
|
|
1277
|
+
})
|
|
1278
|
+
];
|
|
1279
|
+
};
|
|
1273
1280
|
|
|
1274
1281
|
// src/configs/antfu.ts
|
|
1275
1282
|
var antfu = (options = {}) => [
|
|
@@ -1292,6 +1299,13 @@ var antfu = (options = {}) => [
|
|
|
1292
1299
|
];
|
|
1293
1300
|
|
|
1294
1301
|
// src/configs/jsdoc.ts
|
|
1302
|
+
var javscriptRules = {
|
|
1303
|
+
"jsdoc/no-types": "off",
|
|
1304
|
+
"jsdoc/no-undefined-types": "error",
|
|
1305
|
+
"jsdoc/require-param-type": "error",
|
|
1306
|
+
"jsdoc/require-property-type": "error",
|
|
1307
|
+
"jsdoc/require-returns-type": "error"
|
|
1308
|
+
};
|
|
1295
1309
|
var typescriptRules = {
|
|
1296
1310
|
"jsdoc/no-undefined-types": "off",
|
|
1297
1311
|
"jsdoc/require-param-type": "off",
|
|
@@ -1532,7 +1546,7 @@ var jsdoc = (options = {}) => [
|
|
|
1532
1546
|
"jsdoc/require-returns-description": "warn",
|
|
1533
1547
|
"jsdoc/require-yields-check": "warn",
|
|
1534
1548
|
// TypeScript rules overrides
|
|
1535
|
-
...options.typescript ? typescriptRules :
|
|
1549
|
+
...options.typescript ? typescriptRules : javscriptRules,
|
|
1536
1550
|
// Overrides rules
|
|
1537
1551
|
...options.overrides
|
|
1538
1552
|
}
|
|
@@ -3225,41 +3239,36 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3225
3239
|
supportedExtensions.push("vue");
|
|
3226
3240
|
}
|
|
3227
3241
|
if (enableGitIgnore) {
|
|
3228
|
-
configs2.push(
|
|
3229
|
-
...gitignore({
|
|
3230
|
-
...resolveSubOptions(options, "gitignore")
|
|
3231
|
-
})
|
|
3232
|
-
);
|
|
3242
|
+
configs2.push(gitignore(resolveSubOptions(options, "gitignore")));
|
|
3233
3243
|
}
|
|
3234
3244
|
configs2.push(
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3245
|
+
ignores(options.ignores),
|
|
3246
|
+
jsx(),
|
|
3247
|
+
node({
|
|
3238
3248
|
overrides: getOverrides(options, "node")
|
|
3239
3249
|
}),
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
}),
|
|
3243
|
-
...importX({
|
|
3250
|
+
command(resolveSubOptions(options, "command")),
|
|
3251
|
+
importX({
|
|
3244
3252
|
...resolveSubOptions(options, "importX"),
|
|
3245
3253
|
typescript: !!enableTypeScript,
|
|
3246
3254
|
overrides: getOverrides(options, "importX")
|
|
3247
3255
|
}),
|
|
3248
|
-
|
|
3256
|
+
jsdoc({
|
|
3249
3257
|
typescript: !!enableTypeScript,
|
|
3250
|
-
overrides: getOverrides(options, "jsdoc")
|
|
3258
|
+
overrides: getOverrides(options, "jsdoc"),
|
|
3259
|
+
...resolveSubOptions(options, "jsdoc")
|
|
3251
3260
|
}),
|
|
3252
|
-
|
|
3261
|
+
comments({
|
|
3253
3262
|
overrides: getOverrides(options, "comments")
|
|
3254
3263
|
}),
|
|
3255
|
-
|
|
3264
|
+
javascript({
|
|
3256
3265
|
...resolveSubOptions(options, "javascript"),
|
|
3257
3266
|
overrides: getOverrides(options, "javascript")
|
|
3258
3267
|
})
|
|
3259
3268
|
);
|
|
3260
3269
|
if (enablePerfectionist) {
|
|
3261
3270
|
configs2.push(
|
|
3262
|
-
|
|
3271
|
+
perfectionist({
|
|
3263
3272
|
...resolveSubOptions(options, "perfectionist"),
|
|
3264
3273
|
overrides: getOverrides(options, "perfectionist")
|
|
3265
3274
|
})
|
|
@@ -3267,14 +3276,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3267
3276
|
}
|
|
3268
3277
|
if (enableUnicorn) {
|
|
3269
3278
|
configs2.push(
|
|
3270
|
-
|
|
3279
|
+
unicorn({
|
|
3271
3280
|
overrides: getOverrides(options, "unicorn")
|
|
3272
3281
|
})
|
|
3273
3282
|
);
|
|
3274
3283
|
}
|
|
3275
3284
|
if (enablePinia) {
|
|
3276
3285
|
configs2.push(
|
|
3277
|
-
|
|
3286
|
+
pinia({
|
|
3278
3287
|
...resolveSubOptions(options, "pinia"),
|
|
3279
3288
|
overrides: getOverrides(options, "pinia")
|
|
3280
3289
|
})
|
|
@@ -3282,7 +3291,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3282
3291
|
}
|
|
3283
3292
|
if (enableRegexp) {
|
|
3284
3293
|
configs2.push(
|
|
3285
|
-
|
|
3294
|
+
regexp({
|
|
3286
3295
|
...resolveSubOptions(options, "regexp"),
|
|
3287
3296
|
overrides: getOverrides(options, "regexp")
|
|
3288
3297
|
})
|
|
@@ -3290,7 +3299,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3290
3299
|
}
|
|
3291
3300
|
if (enableTypeScript) {
|
|
3292
3301
|
configs2.push(
|
|
3293
|
-
|
|
3302
|
+
typescript({
|
|
3294
3303
|
...resolveSubOptions(options, "typescript"),
|
|
3295
3304
|
extensions: supportedExtensions,
|
|
3296
3305
|
overrides: getOverrides(options, "typescript")
|
|
@@ -3299,7 +3308,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3299
3308
|
}
|
|
3300
3309
|
if (enableVue) {
|
|
3301
3310
|
configs2.push(
|
|
3302
|
-
|
|
3311
|
+
vue({
|
|
3303
3312
|
...resolveSubOptions(options, "vue"),
|
|
3304
3313
|
typescript: !!enableTypeScript,
|
|
3305
3314
|
overrides: getOverrides(options, "vue")
|
|
@@ -3308,52 +3317,48 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3308
3317
|
}
|
|
3309
3318
|
if (enableYML) {
|
|
3310
3319
|
configs2.push(
|
|
3311
|
-
|
|
3320
|
+
yml({
|
|
3312
3321
|
overrides: getOverrides(options, "yml")
|
|
3313
3322
|
})
|
|
3314
3323
|
);
|
|
3315
3324
|
}
|
|
3316
3325
|
if (enableTOML) {
|
|
3317
3326
|
configs2.push(
|
|
3318
|
-
|
|
3327
|
+
toml({
|
|
3319
3328
|
overrides: getOverrides(options, "toml")
|
|
3320
3329
|
})
|
|
3321
3330
|
);
|
|
3322
3331
|
}
|
|
3323
3332
|
if (enableJSONC) {
|
|
3324
3333
|
configs2.push(
|
|
3325
|
-
|
|
3334
|
+
jsonc({
|
|
3326
3335
|
overrides: getOverrides(options, "jsonc")
|
|
3327
3336
|
})
|
|
3328
3337
|
);
|
|
3329
3338
|
}
|
|
3330
3339
|
if (enableSort) {
|
|
3331
|
-
configs2.push(
|
|
3332
|
-
...sort({
|
|
3333
|
-
...resolveSubOptions(options, "sort")
|
|
3334
|
-
})
|
|
3335
|
-
);
|
|
3340
|
+
configs2.push(sort(resolveSubOptions(options, "sort")));
|
|
3336
3341
|
}
|
|
3337
3342
|
if (enableTest) {
|
|
3338
3343
|
configs2.push(
|
|
3339
|
-
|
|
3344
|
+
test({
|
|
3340
3345
|
overrides: getOverrides(options, "test")
|
|
3341
3346
|
}),
|
|
3342
|
-
|
|
3347
|
+
vitest({
|
|
3343
3348
|
overrides: getOverrides(options, "test")
|
|
3344
3349
|
})
|
|
3345
3350
|
);
|
|
3346
3351
|
}
|
|
3347
3352
|
if (enableUnoCSS) {
|
|
3348
3353
|
configs2.push(
|
|
3349
|
-
|
|
3354
|
+
unocss({
|
|
3350
3355
|
overrides: getOverrides(options, "unocss")
|
|
3351
3356
|
})
|
|
3352
3357
|
);
|
|
3353
3358
|
}
|
|
3354
3359
|
if (enableMarkdown) {
|
|
3355
3360
|
configs2.push(
|
|
3356
|
-
|
|
3361
|
+
markdown({
|
|
3357
3362
|
extensions: supportedExtensions,
|
|
3358
3363
|
overrides: getOverrides(options, "markdown")
|
|
3359
3364
|
})
|
|
@@ -3361,14 +3366,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3361
3366
|
}
|
|
3362
3367
|
if (enableAntfu) {
|
|
3363
3368
|
configs2.push(
|
|
3364
|
-
|
|
3369
|
+
antfu({
|
|
3365
3370
|
overrides: getOverrides(options, "antfu")
|
|
3366
3371
|
})
|
|
3367
3372
|
);
|
|
3368
3373
|
}
|
|
3369
3374
|
if (enableDepend) {
|
|
3370
3375
|
configs2.push(
|
|
3371
|
-
|
|
3376
|
+
depend({
|
|
3372
3377
|
...resolveSubOptions(options, "depend"),
|
|
3373
3378
|
overrides: getOverrides(options, "depend")
|
|
3374
3379
|
})
|
|
@@ -3403,15 +3408,9 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3403
3408
|
);
|
|
3404
3409
|
}
|
|
3405
3410
|
if (enableSVGO) {
|
|
3406
|
-
configs2.push(
|
|
3407
|
-
...svgo({
|
|
3408
|
-
...resolveSubOptions(options, "svgo")
|
|
3409
|
-
})
|
|
3410
|
-
);
|
|
3411
|
+
configs2.push(svgo(resolveSubOptions(options, "svgo")));
|
|
3411
3412
|
}
|
|
3412
|
-
const configSpecials = specials(
|
|
3413
|
-
...resolveSubOptions(options, "specials")
|
|
3414
|
-
});
|
|
3413
|
+
const configSpecials = specials(resolveSubOptions(options, "specials"));
|
|
3415
3414
|
const configPrettier = enablePrettier ? prettier({
|
|
3416
3415
|
...resolveSubOptions(options, "prettier"),
|
|
3417
3416
|
overrides: getOverrides(options, "prettier")
|
package/dist/index.d.cts
CHANGED
|
@@ -10,6 +10,7 @@ import { Linter } from 'eslint';
|
|
|
10
10
|
import { ConfigWithExtends } from 'typescript-eslint';
|
|
11
11
|
export { plugin as pluginTypeScript, configs as typescriptConfigs } from 'typescript-eslint';
|
|
12
12
|
import { RequiredOptions, BuiltInParserName } from 'prettier';
|
|
13
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
13
14
|
import * as eslintPluginRegexp from 'eslint-plugin-regexp';
|
|
14
15
|
export { eslintPluginRegexp as pluginRegexp };
|
|
15
16
|
import * as eslintPluginDepend from 'eslint-plugin-depend';
|
|
@@ -1443,7 +1444,7 @@ interface RuleOptions {
|
|
|
1443
1444
|
*/
|
|
1444
1445
|
'default-case'?: Linter.RuleEntry<DefaultCase>;
|
|
1445
1446
|
/**
|
|
1446
|
-
* Enforce `default` clauses in switch statements to be last
|
|
1447
|
+
* Enforce `default` clauses in `switch` statements to be last
|
|
1447
1448
|
* @see https://eslint.org/docs/latest/rules/default-case-last
|
|
1448
1449
|
*/
|
|
1449
1450
|
'default-case-last'?: Linter.RuleEntry<[]>;
|
|
@@ -6004,7 +6005,7 @@ interface RuleOptions {
|
|
|
6004
6005
|
*/
|
|
6005
6006
|
'semi-style'?: Linter.RuleEntry<SemiStyle>;
|
|
6006
6007
|
/**
|
|
6007
|
-
* Enforce sorted import declarations within modules
|
|
6008
|
+
* Enforce sorted `import` declarations within modules
|
|
6008
6009
|
* @see https://eslint.org/docs/latest/rules/sort-imports
|
|
6009
6010
|
*/
|
|
6010
6011
|
'sort-imports'?: Linter.RuleEntry<SortImports>;
|
|
@@ -18404,24 +18405,12 @@ declare function mergePrettierOptions(options?: PrettierOptions, overrides?: Pre
|
|
|
18404
18405
|
|
|
18405
18406
|
declare function isInGitHooksOrRunByNanoStagedOrRunByTSX(): boolean;
|
|
18406
18407
|
|
|
18407
|
-
/**
|
|
18408
|
-
* @file ESLint parsers
|
|
18409
|
-
*/
|
|
18410
|
-
|
|
18411
18408
|
/**
|
|
18412
18409
|
* With meta
|
|
18413
18410
|
*/
|
|
18414
18411
|
declare const parserTypeScript: {
|
|
18415
|
-
meta?: {
|
|
18416
|
-
|
|
18417
|
-
version?: string | undefined;
|
|
18418
|
-
};
|
|
18419
|
-
parseForESLint(text: string, options?: unknown): {
|
|
18420
|
-
ast: unknown;
|
|
18421
|
-
scopeManager?: unknown;
|
|
18422
|
-
services?: unknown;
|
|
18423
|
-
visitorKeys?: unknown;
|
|
18424
|
-
};
|
|
18412
|
+
meta?: { [K in keyof _typescript_eslint_utils_ts_eslint.Parser.ParserMeta]?: _typescript_eslint_utils_ts_eslint.Parser.ParserMeta[K] | undefined; };
|
|
18413
|
+
parseForESLint(text: string, options?: unknown): { [k in keyof _typescript_eslint_utils_ts_eslint.Parser.ParseResult]: unknown; };
|
|
18425
18414
|
};
|
|
18426
18415
|
|
|
18427
18416
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Linter } from 'eslint';
|
|
|
10
10
|
import { ConfigWithExtends } from 'typescript-eslint';
|
|
11
11
|
export { plugin as pluginTypeScript, configs as typescriptConfigs } from 'typescript-eslint';
|
|
12
12
|
import { RequiredOptions, BuiltInParserName } from 'prettier';
|
|
13
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
13
14
|
import * as eslintPluginRegexp from 'eslint-plugin-regexp';
|
|
14
15
|
export { eslintPluginRegexp as pluginRegexp };
|
|
15
16
|
import * as eslintPluginDepend from 'eslint-plugin-depend';
|
|
@@ -1443,7 +1444,7 @@ interface RuleOptions {
|
|
|
1443
1444
|
*/
|
|
1444
1445
|
'default-case'?: Linter.RuleEntry<DefaultCase>;
|
|
1445
1446
|
/**
|
|
1446
|
-
* Enforce `default` clauses in switch statements to be last
|
|
1447
|
+
* Enforce `default` clauses in `switch` statements to be last
|
|
1447
1448
|
* @see https://eslint.org/docs/latest/rules/default-case-last
|
|
1448
1449
|
*/
|
|
1449
1450
|
'default-case-last'?: Linter.RuleEntry<[]>;
|
|
@@ -6004,7 +6005,7 @@ interface RuleOptions {
|
|
|
6004
6005
|
*/
|
|
6005
6006
|
'semi-style'?: Linter.RuleEntry<SemiStyle>;
|
|
6006
6007
|
/**
|
|
6007
|
-
* Enforce sorted import declarations within modules
|
|
6008
|
+
* Enforce sorted `import` declarations within modules
|
|
6008
6009
|
* @see https://eslint.org/docs/latest/rules/sort-imports
|
|
6009
6010
|
*/
|
|
6010
6011
|
'sort-imports'?: Linter.RuleEntry<SortImports>;
|
|
@@ -18404,24 +18405,12 @@ declare function mergePrettierOptions(options?: PrettierOptions, overrides?: Pre
|
|
|
18404
18405
|
|
|
18405
18406
|
declare function isInGitHooksOrRunByNanoStagedOrRunByTSX(): boolean;
|
|
18406
18407
|
|
|
18407
|
-
/**
|
|
18408
|
-
* @file ESLint parsers
|
|
18409
|
-
*/
|
|
18410
|
-
|
|
18411
18408
|
/**
|
|
18412
18409
|
* With meta
|
|
18413
18410
|
*/
|
|
18414
18411
|
declare const parserTypeScript: {
|
|
18415
|
-
meta?: {
|
|
18416
|
-
|
|
18417
|
-
version?: string | undefined;
|
|
18418
|
-
};
|
|
18419
|
-
parseForESLint(text: string, options?: unknown): {
|
|
18420
|
-
ast: unknown;
|
|
18421
|
-
scopeManager?: unknown;
|
|
18422
|
-
services?: unknown;
|
|
18423
|
-
visitorKeys?: unknown;
|
|
18424
|
-
};
|
|
18412
|
+
meta?: { [K in keyof _typescript_eslint_utils_ts_eslint.Parser.ParserMeta]?: _typescript_eslint_utils_ts_eslint.Parser.ParserMeta[K] | undefined; };
|
|
18413
|
+
parseForESLint(text: string, options?: unknown): { [k in keyof _typescript_eslint_utils_ts_eslint.Parser.ParseResult]: unknown; };
|
|
18425
18414
|
};
|
|
18426
18415
|
|
|
18427
18416
|
/**
|
package/dist/index.js
CHANGED
|
@@ -612,7 +612,7 @@ async function ensurePackages(packages) {
|
|
|
612
612
|
if (process3.env.CI || !process3.stdout.isTTY || isInGitHooksOrRunByNanoStagedOrRunByTSX() || !isCwdInScope) {
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
615
|
-
const nonExistingPackages = packages.filter((pkg) => !!pkg && isPackageInScope(pkg));
|
|
615
|
+
const nonExistingPackages = packages.filter((pkg) => !!pkg && !isPackageInScope(pkg));
|
|
616
616
|
if (nonExistingPackages.length === 0) {
|
|
617
617
|
return;
|
|
618
618
|
}
|
|
@@ -1102,13 +1102,20 @@ var vitest = (options = {}) => {
|
|
|
1102
1102
|
};
|
|
1103
1103
|
|
|
1104
1104
|
// src/configs/svgo.ts
|
|
1105
|
-
import {
|
|
1106
|
-
var svgo = (options = {}) =>
|
|
1107
|
-
{
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1105
|
+
import { createConfig as createSVGOConfig } from "eslint-plugin-svgo";
|
|
1106
|
+
var svgo = (options = {}) => {
|
|
1107
|
+
const { files = [GLOB_SVG], rules: overridesRules = {} } = options;
|
|
1108
|
+
return [
|
|
1109
|
+
createSVGOConfig({
|
|
1110
|
+
name: "ntnyq/svgo",
|
|
1111
|
+
files,
|
|
1112
|
+
rules: {
|
|
1113
|
+
"svgo/svgo": "error",
|
|
1114
|
+
...overridesRules
|
|
1115
|
+
}
|
|
1116
|
+
})
|
|
1117
|
+
];
|
|
1118
|
+
};
|
|
1112
1119
|
|
|
1113
1120
|
// src/configs/antfu.ts
|
|
1114
1121
|
var antfu = (options = {}) => [
|
|
@@ -1131,6 +1138,13 @@ var antfu = (options = {}) => [
|
|
|
1131
1138
|
];
|
|
1132
1139
|
|
|
1133
1140
|
// src/configs/jsdoc.ts
|
|
1141
|
+
var javscriptRules = {
|
|
1142
|
+
"jsdoc/no-types": "off",
|
|
1143
|
+
"jsdoc/no-undefined-types": "error",
|
|
1144
|
+
"jsdoc/require-param-type": "error",
|
|
1145
|
+
"jsdoc/require-property-type": "error",
|
|
1146
|
+
"jsdoc/require-returns-type": "error"
|
|
1147
|
+
};
|
|
1134
1148
|
var typescriptRules = {
|
|
1135
1149
|
"jsdoc/no-undefined-types": "off",
|
|
1136
1150
|
"jsdoc/require-param-type": "off",
|
|
@@ -1371,7 +1385,7 @@ var jsdoc = (options = {}) => [
|
|
|
1371
1385
|
"jsdoc/require-returns-description": "warn",
|
|
1372
1386
|
"jsdoc/require-yields-check": "warn",
|
|
1373
1387
|
// TypeScript rules overrides
|
|
1374
|
-
...options.typescript ? typescriptRules :
|
|
1388
|
+
...options.typescript ? typescriptRules : javscriptRules,
|
|
1375
1389
|
// Overrides rules
|
|
1376
1390
|
...options.overrides
|
|
1377
1391
|
}
|
|
@@ -3064,41 +3078,36 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3064
3078
|
supportedExtensions.push("vue");
|
|
3065
3079
|
}
|
|
3066
3080
|
if (enableGitIgnore) {
|
|
3067
|
-
configs2.push(
|
|
3068
|
-
...gitignore({
|
|
3069
|
-
...resolveSubOptions(options, "gitignore")
|
|
3070
|
-
})
|
|
3071
|
-
);
|
|
3081
|
+
configs2.push(gitignore(resolveSubOptions(options, "gitignore")));
|
|
3072
3082
|
}
|
|
3073
3083
|
configs2.push(
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3084
|
+
ignores(options.ignores),
|
|
3085
|
+
jsx(),
|
|
3086
|
+
node({
|
|
3077
3087
|
overrides: getOverrides(options, "node")
|
|
3078
3088
|
}),
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
}),
|
|
3082
|
-
...importX({
|
|
3089
|
+
command(resolveSubOptions(options, "command")),
|
|
3090
|
+
importX({
|
|
3083
3091
|
...resolveSubOptions(options, "importX"),
|
|
3084
3092
|
typescript: !!enableTypeScript,
|
|
3085
3093
|
overrides: getOverrides(options, "importX")
|
|
3086
3094
|
}),
|
|
3087
|
-
|
|
3095
|
+
jsdoc({
|
|
3088
3096
|
typescript: !!enableTypeScript,
|
|
3089
|
-
overrides: getOverrides(options, "jsdoc")
|
|
3097
|
+
overrides: getOverrides(options, "jsdoc"),
|
|
3098
|
+
...resolveSubOptions(options, "jsdoc")
|
|
3090
3099
|
}),
|
|
3091
|
-
|
|
3100
|
+
comments({
|
|
3092
3101
|
overrides: getOverrides(options, "comments")
|
|
3093
3102
|
}),
|
|
3094
|
-
|
|
3103
|
+
javascript({
|
|
3095
3104
|
...resolveSubOptions(options, "javascript"),
|
|
3096
3105
|
overrides: getOverrides(options, "javascript")
|
|
3097
3106
|
})
|
|
3098
3107
|
);
|
|
3099
3108
|
if (enablePerfectionist) {
|
|
3100
3109
|
configs2.push(
|
|
3101
|
-
|
|
3110
|
+
perfectionist({
|
|
3102
3111
|
...resolveSubOptions(options, "perfectionist"),
|
|
3103
3112
|
overrides: getOverrides(options, "perfectionist")
|
|
3104
3113
|
})
|
|
@@ -3106,14 +3115,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3106
3115
|
}
|
|
3107
3116
|
if (enableUnicorn) {
|
|
3108
3117
|
configs2.push(
|
|
3109
|
-
|
|
3118
|
+
unicorn({
|
|
3110
3119
|
overrides: getOverrides(options, "unicorn")
|
|
3111
3120
|
})
|
|
3112
3121
|
);
|
|
3113
3122
|
}
|
|
3114
3123
|
if (enablePinia) {
|
|
3115
3124
|
configs2.push(
|
|
3116
|
-
|
|
3125
|
+
pinia({
|
|
3117
3126
|
...resolveSubOptions(options, "pinia"),
|
|
3118
3127
|
overrides: getOverrides(options, "pinia")
|
|
3119
3128
|
})
|
|
@@ -3121,7 +3130,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3121
3130
|
}
|
|
3122
3131
|
if (enableRegexp) {
|
|
3123
3132
|
configs2.push(
|
|
3124
|
-
|
|
3133
|
+
regexp({
|
|
3125
3134
|
...resolveSubOptions(options, "regexp"),
|
|
3126
3135
|
overrides: getOverrides(options, "regexp")
|
|
3127
3136
|
})
|
|
@@ -3129,7 +3138,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3129
3138
|
}
|
|
3130
3139
|
if (enableTypeScript) {
|
|
3131
3140
|
configs2.push(
|
|
3132
|
-
|
|
3141
|
+
typescript({
|
|
3133
3142
|
...resolveSubOptions(options, "typescript"),
|
|
3134
3143
|
extensions: supportedExtensions,
|
|
3135
3144
|
overrides: getOverrides(options, "typescript")
|
|
@@ -3138,7 +3147,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3138
3147
|
}
|
|
3139
3148
|
if (enableVue) {
|
|
3140
3149
|
configs2.push(
|
|
3141
|
-
|
|
3150
|
+
vue({
|
|
3142
3151
|
...resolveSubOptions(options, "vue"),
|
|
3143
3152
|
typescript: !!enableTypeScript,
|
|
3144
3153
|
overrides: getOverrides(options, "vue")
|
|
@@ -3147,52 +3156,48 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3147
3156
|
}
|
|
3148
3157
|
if (enableYML) {
|
|
3149
3158
|
configs2.push(
|
|
3150
|
-
|
|
3159
|
+
yml({
|
|
3151
3160
|
overrides: getOverrides(options, "yml")
|
|
3152
3161
|
})
|
|
3153
3162
|
);
|
|
3154
3163
|
}
|
|
3155
3164
|
if (enableTOML) {
|
|
3156
3165
|
configs2.push(
|
|
3157
|
-
|
|
3166
|
+
toml({
|
|
3158
3167
|
overrides: getOverrides(options, "toml")
|
|
3159
3168
|
})
|
|
3160
3169
|
);
|
|
3161
3170
|
}
|
|
3162
3171
|
if (enableJSONC) {
|
|
3163
3172
|
configs2.push(
|
|
3164
|
-
|
|
3173
|
+
jsonc({
|
|
3165
3174
|
overrides: getOverrides(options, "jsonc")
|
|
3166
3175
|
})
|
|
3167
3176
|
);
|
|
3168
3177
|
}
|
|
3169
3178
|
if (enableSort) {
|
|
3170
|
-
configs2.push(
|
|
3171
|
-
...sort({
|
|
3172
|
-
...resolveSubOptions(options, "sort")
|
|
3173
|
-
})
|
|
3174
|
-
);
|
|
3179
|
+
configs2.push(sort(resolveSubOptions(options, "sort")));
|
|
3175
3180
|
}
|
|
3176
3181
|
if (enableTest) {
|
|
3177
3182
|
configs2.push(
|
|
3178
|
-
|
|
3183
|
+
test({
|
|
3179
3184
|
overrides: getOverrides(options, "test")
|
|
3180
3185
|
}),
|
|
3181
|
-
|
|
3186
|
+
vitest({
|
|
3182
3187
|
overrides: getOverrides(options, "test")
|
|
3183
3188
|
})
|
|
3184
3189
|
);
|
|
3185
3190
|
}
|
|
3186
3191
|
if (enableUnoCSS) {
|
|
3187
3192
|
configs2.push(
|
|
3188
|
-
|
|
3193
|
+
unocss({
|
|
3189
3194
|
overrides: getOverrides(options, "unocss")
|
|
3190
3195
|
})
|
|
3191
3196
|
);
|
|
3192
3197
|
}
|
|
3193
3198
|
if (enableMarkdown) {
|
|
3194
3199
|
configs2.push(
|
|
3195
|
-
|
|
3200
|
+
markdown({
|
|
3196
3201
|
extensions: supportedExtensions,
|
|
3197
3202
|
overrides: getOverrides(options, "markdown")
|
|
3198
3203
|
})
|
|
@@ -3200,14 +3205,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3200
3205
|
}
|
|
3201
3206
|
if (enableAntfu) {
|
|
3202
3207
|
configs2.push(
|
|
3203
|
-
|
|
3208
|
+
antfu({
|
|
3204
3209
|
overrides: getOverrides(options, "antfu")
|
|
3205
3210
|
})
|
|
3206
3211
|
);
|
|
3207
3212
|
}
|
|
3208
3213
|
if (enableDepend) {
|
|
3209
3214
|
configs2.push(
|
|
3210
|
-
|
|
3215
|
+
depend({
|
|
3211
3216
|
...resolveSubOptions(options, "depend"),
|
|
3212
3217
|
overrides: getOverrides(options, "depend")
|
|
3213
3218
|
})
|
|
@@ -3242,15 +3247,9 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3242
3247
|
);
|
|
3243
3248
|
}
|
|
3244
3249
|
if (enableSVGO) {
|
|
3245
|
-
configs2.push(
|
|
3246
|
-
...svgo({
|
|
3247
|
-
...resolveSubOptions(options, "svgo")
|
|
3248
|
-
})
|
|
3249
|
-
);
|
|
3250
|
+
configs2.push(svgo(resolveSubOptions(options, "svgo")));
|
|
3250
3251
|
}
|
|
3251
|
-
const configSpecials = specials(
|
|
3252
|
-
...resolveSubOptions(options, "specials")
|
|
3253
|
-
});
|
|
3252
|
+
const configSpecials = specials(resolveSubOptions(options, "specials"));
|
|
3254
3253
|
const configPrettier = enablePrettier ? prettier({
|
|
3255
3254
|
...resolveSubOptions(options, "prettier"),
|
|
3256
3255
|
overrides: getOverrides(options, "prettier")
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.12.
|
|
4
|
+
"version": "3.12.1",
|
|
5
5
|
"packageManager": "pnpm@9.15.3",
|
|
6
6
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
7
7
|
"keywords": [
|
|
@@ -41,9 +41,11 @@
|
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "pnpm run generate:type && tsup",
|
|
43
43
|
"dev": "tsup --watch src",
|
|
44
|
+
"docs:build": "pnpm -C docs run build",
|
|
45
|
+
"docs:dev": "pnpm -C docs run dev",
|
|
44
46
|
"generate:site": "tsx scripts/generateSite.ts",
|
|
45
47
|
"generate:type": "tsx scripts/generateType.ts",
|
|
46
|
-
"lint": "eslint
|
|
48
|
+
"lint": "eslint .",
|
|
47
49
|
"prepare": "husky",
|
|
48
50
|
"release": "run-s release:check release:version",
|
|
49
51
|
"release:check": "run-s build lint typecheck",
|
|
@@ -72,9 +74,9 @@
|
|
|
72
74
|
"@antfu/install-pkg": "^1.0.0",
|
|
73
75
|
"@clack/prompts": "^0.9.1",
|
|
74
76
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
75
|
-
"@eslint/js": "^9.
|
|
77
|
+
"@eslint/js": "^9.18.0",
|
|
76
78
|
"@eslint/markdown": "^6.2.1",
|
|
77
|
-
"@unocss/eslint-plugin": "^
|
|
79
|
+
"@unocss/eslint-plugin": "^65.4.0",
|
|
78
80
|
"@vitest/eslint-plugin": "^1.1.24",
|
|
79
81
|
"eslint-config-flat-gitignore": "^1.0.0",
|
|
80
82
|
"eslint-flat-config-utils": "^1.0.0",
|
|
@@ -94,7 +96,7 @@
|
|
|
94
96
|
"eslint-plugin-pinia": "^0.4.1",
|
|
95
97
|
"eslint-plugin-prettier": "^5.2.1",
|
|
96
98
|
"eslint-plugin-regexp": "^2.7.0",
|
|
97
|
-
"eslint-plugin-svgo": "^0.
|
|
99
|
+
"eslint-plugin-svgo": "^0.4.0",
|
|
98
100
|
"eslint-plugin-toml": "^0.12.0",
|
|
99
101
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
100
102
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
@@ -114,7 +116,7 @@
|
|
|
114
116
|
"@ntnyq/prettier-config": "^1.22.1",
|
|
115
117
|
"@types/node": "^22.10.5",
|
|
116
118
|
"bumpp": "^9.10.0",
|
|
117
|
-
"eslint": "^9.
|
|
119
|
+
"eslint": "^9.18.0",
|
|
118
120
|
"eslint-typegen": "^1.0.0",
|
|
119
121
|
"husky": "^9.1.7",
|
|
120
122
|
"jiti": "^2.4.2",
|
|
@@ -135,6 +137,6 @@
|
|
|
135
137
|
}
|
|
136
138
|
},
|
|
137
139
|
"nano-staged": {
|
|
138
|
-
"*.{js,ts,mjs,cjs,json,jsonc,md,yaml,yml}": "eslint --
|
|
140
|
+
"*.{js,ts,mjs,cjs,vue,svg,json,jsonc,md,yaml,yml}": "eslint --fix"
|
|
139
141
|
}
|
|
140
142
|
}
|