@ntnyq/eslint-config 3.12.3 → 4.0.0-beta.2

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.js CHANGED
@@ -52,10 +52,11 @@ import { default as default14 } from "@vitest/eslint-plugin";
52
52
  import { default as default15 } from "eslint-plugin-unicorn";
53
53
  import { default as default16 } from "eslint-plugin-import-x";
54
54
  import { default as default17 } from "eslint-plugin-prettier";
55
- import { default as default18 } from "eslint-plugin-github-action";
56
- import { default as default19 } from "eslint-plugin-perfectionist";
57
- import { default as default20 } from "eslint-plugin-unused-imports";
58
- import { default as default21 } from "@eslint-community/eslint-plugin-eslint-comments";
55
+ import { default as default18 } from "eslint-plugin-no-only-tests";
56
+ import { default as default19 } from "eslint-plugin-github-action";
57
+ import { default as default20 } from "eslint-plugin-perfectionist";
58
+ import { default as default21 } from "eslint-plugin-unused-imports";
59
+ import { default as default22 } from "@eslint-community/eslint-plugin-eslint-comments";
59
60
 
60
61
  // src/eslint/configs.ts
61
62
  import { configs } from "typescript-eslint";
@@ -67,7 +68,7 @@ var createNodeResolver = default16.createNodeResolver;
67
68
  // src/eslint/processors.ts
68
69
  import { mergeProcessors } from "eslint-merge-processors";
69
70
  import { processorPassThrough } from "eslint-merge-processors";
70
- import { default as default22 } from "eslint-processor-vue-blocks";
71
+ import { default as default23 } from "eslint-processor-vue-blocks";
71
72
 
72
73
  // src/globs.ts
73
74
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
@@ -176,13 +177,7 @@ var GLOB_EXCLUDE = [
176
177
  ];
177
178
 
178
179
  // src/configs/vue.ts
179
- var vue2Rules = {
180
- ...default3.configs.base.rules,
181
- ...default3.configs.essential.rules,
182
- ...default3.configs["strongly-recommended"].rules,
183
- ...default3.configs.recommended.rules
184
- };
185
- var vue3Rules = {
180
+ var sharedRules = {
186
181
  ...default3.configs.base.rules,
187
182
  ...default3.configs["vue3-essential"].rules,
188
183
  ...default3.configs["vue3-strongly-recommended"].rules,
@@ -374,16 +369,15 @@ var unCategorizedRules = {
374
369
  }
375
370
  ]
376
371
  };
377
- var vue = (options = {}) => {
378
- const isVue3 = options.vueVersion !== 2;
372
+ var configVue = (options = {}) => {
373
+ const { files = [GLOB_VUE] } = options;
379
374
  const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
380
- const { files: FILES_VUE = [GLOB_VUE] } = options;
381
375
  function getVueProcessor() {
382
376
  const processorVueSFC = default3.processors[".vue"];
383
377
  if (!sfcBlocks) return processorVueSFC;
384
378
  return mergeProcessors2([
385
379
  processorVueSFC,
386
- default22({
380
+ default23({
387
381
  ...sfcBlocks,
388
382
  blocks: {
389
383
  styles: true,
@@ -402,10 +396,7 @@ var vue = (options = {}) => {
402
396
  },
403
397
  {
404
398
  name: "ntnyq/vue/rules",
405
- files: [
406
- // File apply vue rules
407
- ...FILES_VUE
408
- ],
399
+ files,
409
400
  languageOptions: {
410
401
  parser: parserVue,
411
402
  parserOptions: {
@@ -420,7 +411,7 @@ var vue = (options = {}) => {
420
411
  },
421
412
  processor: getVueProcessor(),
422
413
  rules: {
423
- ...isVue3 ? vue3Rules : vue2Rules,
414
+ ...sharedRules,
424
415
  "vue/html-self-closing": [
425
416
  "error",
426
417
  {
@@ -530,9 +521,9 @@ var vue = (options = {}) => {
530
521
  };
531
522
 
532
523
  // src/configs/yml.ts
533
- var yml = (options = {}) => [
524
+ var configYml = (options = {}) => [
534
525
  {
535
- name: "ntnyq/yaml",
526
+ name: "ntnyq/yml",
536
527
  files: [GLOB_YAML],
537
528
  languageOptions: {
538
529
  parser: parserYaml
@@ -551,126 +542,8 @@ var yml = (options = {}) => [
551
542
  }
552
543
  ];
553
544
 
554
- // src/utils/env.ts
555
- import { resolve } from "node:path";
556
- import process from "node:process";
557
- import { isPackageExists } from "local-pkg";
558
- var hasPinia = isPackageExists("pinia");
559
- var hasVitest = isPackageExists("vitest");
560
- var hasTypeScript = isPackageExists("typescript");
561
- var hasShadcnVue = isPackageExists("radix-vue") && isPackageExists("clsx");
562
- var hasUnoCSS = isPackageExists("unocss") || isPackageExists("@unocss/postcss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
563
- var hasVue = isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("vuepress") || isPackageExists("@slidev/cli") || isPackageExists("vue", {
564
- paths: [resolve(process.cwd(), "playground"), resolve(process.cwd(), "docs")]
565
- });
566
-
567
- // src/utils/toArray.ts
568
- function toArray(val) {
569
- val = val ?? [];
570
- return Array.isArray(val) ? val : [val];
571
- }
572
-
573
- // src/utils/resolveSubOptions.ts
574
- function resolveSubOptions(options, key) {
575
- return typeof options[key] === "boolean" ? {} : options[key] || {};
576
- }
577
-
578
- // src/utils/getOverrides.ts
579
- function getOverrides(options, key) {
580
- const subOptions = resolveSubOptions(options, key);
581
- return "overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {};
582
- }
583
-
584
- // src/utils/combineConfigs.ts
585
- async function combineConfigs(...configs2) {
586
- const resolved = await Promise.all(configs2);
587
- return resolved.flat();
588
- }
589
-
590
- // src/utils/ensurePackages.ts
591
- import process3 from "node:process";
592
- import { fileURLToPath } from "node:url";
593
- import { isPackageExists as isPackageExists2 } from "local-pkg";
594
-
595
- // src/utils/isInGitHooksOrRunByNanoStagedOrRunByTSX.ts
596
- import process2 from "node:process";
597
- function isInGitHooksOrRunByNanoStagedOrRunByTSX() {
598
- return !!(process2.env.GIT_PARAMS || process2.env.VSCODE_GIT_COMMAND || // lint staged files
599
- process2.env.npm_lifecycle_script?.startsWith("nano-staged") || // run `scripts/generateType.ts`
600
- process2.env.npm_lifecycle_script?.startsWith("tsx"));
601
- }
602
-
603
- // src/utils/ensurePackages.ts
604
- var scopeUrl = fileURLToPath(new URL(".", import.meta.url));
605
- var isCwdInScope = isPackageExists2("@ntnyq/eslint-config");
606
- function isPackageInScope(name) {
607
- return isPackageExists2(name, {
608
- paths: [scopeUrl]
609
- });
610
- }
611
- async function ensurePackages(packages) {
612
- if (process3.env.CI || !process3.stdout.isTTY || isInGitHooksOrRunByNanoStagedOrRunByTSX() || !isCwdInScope) {
613
- return;
614
- }
615
- const nonExistingPackages = packages.filter((pkg) => !!pkg && !isPackageInScope(pkg));
616
- if (nonExistingPackages.length === 0) {
617
- return;
618
- }
619
- const { confirm } = await import("@clack/prompts");
620
- const confirmInstall = await confirm({
621
- message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
622
- });
623
- if (confirmInstall) {
624
- try {
625
- const { installPackage } = await import("@antfu/install-pkg");
626
- await installPackage(nonExistingPackages, { dev: true });
627
- } catch (err) {
628
- console.log(err);
629
- }
630
- }
631
- }
632
-
633
- // src/utils/interopDefault.ts
634
- async function interopDefault(mod) {
635
- const resolved = await mod;
636
- return resolved.default || resolved;
637
- }
638
-
639
- // src/utils/mergePrettierOptions.ts
640
- function mergePrettierOptions(options = {}, overrides = {}) {
641
- const result = {
642
- ...options,
643
- ...overrides,
644
- plugins: [
645
- // built-in plugins
646
- ...options.plugins || [],
647
- // custom plugins
648
- ...overrides.plugins || []
649
- ]
650
- };
651
- return result;
652
- }
653
-
654
- // src/configs/esX.ts
655
- var esX = async (options = {}) => {
656
- await ensurePackages(["eslint-plugin-es-x"]);
657
- const pluginEsX = await interopDefault(import("eslint-plugin-es-x"));
658
- return [
659
- {
660
- name: "ntnyq/es-x",
661
- plugins: {
662
- "es-x": pluginEsX
663
- },
664
- rules: {
665
- // Overrides rules
666
- ...options.overrides
667
- }
668
- }
669
- ];
670
- };
671
-
672
545
  // src/configs/node.ts
673
- var node = (options = {}) => [
546
+ var configNode = (options = {}) => [
674
547
  {
675
548
  name: "ntnyq/node",
676
549
  plugins: {
@@ -692,7 +565,7 @@ var node = (options = {}) => [
692
565
  ];
693
566
 
694
567
  // src/configs/sort.ts
695
- var sort = (options = {}) => {
568
+ var configSort = (options = {}) => {
696
569
  const configs2 = [];
697
570
  const {
698
571
  tsconfig: enableSortTsconfig = true,
@@ -1033,7 +906,7 @@ var sort = (options = {}) => {
1033
906
  };
1034
907
 
1035
908
  // src/configs/toml.ts
1036
- var toml = (options = {}) => [
909
+ var configToml = (options = {}) => [
1037
910
  {
1038
911
  name: "ntnyq/toml",
1039
912
  files: [GLOB_TOML],
@@ -1069,41 +942,152 @@ var toml = (options = {}) => [
1069
942
  }
1070
943
  ];
1071
944
 
1072
- // src/configs/test.ts
1073
- var test = (options = {}) => [
1074
- {
1075
- name: "ntnyq/test",
1076
- files: [...GLOB_TEST],
1077
- rules: {
1078
- "no-unused-expressions": "off",
1079
- "max-lines-per-function": "off",
1080
- // Overrides rules
1081
- ...options.overrides
945
+ // src/utils/env.ts
946
+ import { resolve } from "node:path";
947
+ import process from "node:process";
948
+ import { isPackageExists } from "local-pkg";
949
+ var hasPinia = () => isPackageExists("pinia");
950
+ var hasVitest = () => isPackageExists("vitest");
951
+ var hasTypeScript = () => isPackageExists("typescript");
952
+ var hasShadcnVue = () => isPackageExists("radix-vue") && isPackageExists("clsx");
953
+ var hasUnoCSS = () => isPackageExists("unocss") || isPackageExists("@unocss/postcss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
954
+ var hasVue = () => isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("vuepress") || isPackageExists("@slidev/cli") || isPackageExists("vue", {
955
+ paths: [resolve(process.cwd(), "playground"), resolve(process.cwd(), "docs")]
956
+ });
957
+
958
+ // src/utils/toArray.ts
959
+ function toArray(val) {
960
+ val = val ?? [];
961
+ return Array.isArray(val) ? val : [val];
962
+ }
963
+
964
+ // src/utils/resolveSubOptions.ts
965
+ function resolveSubOptions(options, key) {
966
+ return typeof options[key] === "boolean" ? {} : options[key] || {};
967
+ }
968
+
969
+ // src/utils/getOverrides.ts
970
+ function getOverrides(options, key) {
971
+ const subOptions = resolveSubOptions(options, key);
972
+ return "overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {};
973
+ }
974
+
975
+ // src/utils/combineConfigs.ts
976
+ async function combineConfigs(...configs2) {
977
+ const resolved = await Promise.all(configs2);
978
+ return resolved.flat();
979
+ }
980
+
981
+ // src/utils/ensurePackages.ts
982
+ import process3 from "node:process";
983
+ import { fileURLToPath } from "node:url";
984
+ import { isPackageExists as isPackageExists2 } from "local-pkg";
985
+
986
+ // src/utils/isInGitHooksOrRunByNanoStagedOrRunByTSX.ts
987
+ import process2 from "node:process";
988
+ function isInGitHooksOrRunByNanoStagedOrRunByTSX() {
989
+ return !!(process2.env.GIT_PARAMS || process2.env.VSCODE_GIT_COMMAND || // lint staged files
990
+ process2.env.npm_lifecycle_script?.startsWith("nano-staged") || // run `scripts/generateType.ts`
991
+ process2.env.npm_lifecycle_script?.startsWith("tsx"));
992
+ }
993
+
994
+ // src/utils/ensurePackages.ts
995
+ var scopeUrl = fileURLToPath(new URL(".", import.meta.url));
996
+ var isCwdInScope = isPackageExists2("@ntnyq/eslint-config");
997
+ function isPackageInScope(name) {
998
+ return isPackageExists2(name, {
999
+ paths: [scopeUrl]
1000
+ });
1001
+ }
1002
+ async function ensurePackages(packages) {
1003
+ if (process3.env.CI || !process3.stdout.isTTY || isInGitHooksOrRunByNanoStagedOrRunByTSX() || !isCwdInScope) {
1004
+ return;
1005
+ }
1006
+ const nonExistingPackages = packages.filter((pkg) => !!pkg && !isPackageInScope(pkg));
1007
+ if (nonExistingPackages.length === 0) {
1008
+ return;
1009
+ }
1010
+ const { confirm } = await import("@clack/prompts");
1011
+ const confirmInstall = await confirm({
1012
+ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
1013
+ });
1014
+ if (confirmInstall) {
1015
+ try {
1016
+ const { installPackage } = await import("@antfu/install-pkg");
1017
+ await installPackage(nonExistingPackages, { dev: true });
1018
+ } catch (err) {
1019
+ console.log(err);
1082
1020
  }
1083
1021
  }
1084
- ];
1085
- var vitest = (options = {}) => {
1086
- if (!default14.configs?.recommended) return [];
1087
- const vitestConfigs = default14.configs;
1088
- return [
1022
+ }
1023
+
1024
+ // src/utils/interopDefault.ts
1025
+ async function interopDefault(mod) {
1026
+ const resolved = await mod;
1027
+ return resolved.default || resolved;
1028
+ }
1029
+
1030
+ // src/utils/mergePrettierOptions.ts
1031
+ function mergePrettierOptions(options = {}, overrides = {}) {
1032
+ const result = {
1033
+ ...options,
1034
+ ...overrides,
1035
+ plugins: [
1036
+ // built-in plugins
1037
+ ...options.plugins || [],
1038
+ // custom plugins
1039
+ ...overrides.plugins || []
1040
+ ]
1041
+ };
1042
+ return result;
1043
+ }
1044
+
1045
+ // src/configs/test.ts
1046
+ var configTest = (options = {}) => {
1047
+ const {
1048
+ // default test files
1049
+ files = [...GLOB_TEST],
1050
+ vitest: enableVitest = hasVitest()
1051
+ } = options;
1052
+ const configs2 = [
1089
1053
  {
1090
- name: "ntnyq/vitest",
1054
+ name: "ntnyq/test/setup",
1055
+ plugins: {
1056
+ "no-only-tests": default18
1057
+ }
1058
+ },
1059
+ {
1060
+ name: "ntnyq/test/base",
1061
+ files,
1062
+ rules: {
1063
+ "no-unused-expressions": "off",
1064
+ "max-lines-per-function": "off",
1065
+ "no-only-tests/no-only-tests": "error",
1066
+ // Overrides rules
1067
+ ...options.overrides
1068
+ }
1069
+ }
1070
+ ];
1071
+ if (enableVitest) {
1072
+ configs2.push({
1073
+ name: "ntnyq/test/vitest",
1074
+ files,
1091
1075
  plugins: {
1092
1076
  vitest: default14
1093
1077
  },
1094
- files: [...GLOB_TEST],
1095
1078
  rules: {
1096
- ...vitestConfigs.recommended.rules,
1079
+ ...default14.configs.recommended.rules,
1097
1080
  // Overrides rules
1098
1081
  ...options.overridesVitestRules
1099
1082
  }
1100
- }
1101
- ];
1083
+ });
1084
+ }
1085
+ return configs2;
1102
1086
  };
1103
1087
 
1104
1088
  // src/configs/svgo.ts
1105
1089
  import { createConfig as createSVGOConfig } from "eslint-plugin-svgo";
1106
- var svgo = (options = {}) => {
1090
+ var configSVGO = (options = {}) => {
1107
1091
  const { files = [GLOB_SVG], rules: overridesRules = {} } = options;
1108
1092
  return [
1109
1093
  createSVGOConfig({
@@ -1118,7 +1102,7 @@ var svgo = (options = {}) => {
1118
1102
  };
1119
1103
 
1120
1104
  // src/configs/antfu.ts
1121
- var antfu = (options = {}) => [
1105
+ var configAntfu = (options = {}) => [
1122
1106
  {
1123
1107
  name: "ntnyq/antfu",
1124
1108
  plugins: {
@@ -1152,7 +1136,7 @@ var typescriptRules = {
1152
1136
  "jsdoc/require-returns-type": "off",
1153
1137
  "jsdoc/no-types": "error"
1154
1138
  };
1155
- var jsdoc = (options = {}) => [
1139
+ var configJsdoc = (options = {}) => [
1156
1140
  {
1157
1141
  name: "ntnyq/jsdoc",
1158
1142
  plugins: {
@@ -1199,6 +1183,9 @@ var jsdoc = (options = {}) => [
1199
1183
  // magic-comments
1200
1184
  "vite-ignore",
1201
1185
  "unocss-include",
1186
+ // defined perfectionist group
1187
+ "pg",
1188
+ "perfectionist-group",
1202
1189
  // eslint-plugin-command (block comment only)
1203
1190
  "regex101",
1204
1191
  // non-standard, but common used
@@ -1209,172 +1196,6 @@ var jsdoc = (options = {}) => [
1209
1196
  ]
1210
1197
  }
1211
1198
  ],
1212
- // TODO: this after investigate
1213
- // 'jsdoc/sort-tags': [
1214
- // 'error',
1215
- // {
1216
- // tagSequence: [
1217
- // {
1218
- // // Module/file-level
1219
- // tags: ['module', 'exports', 'file', 'fileoverview', 'overview', 'import'],
1220
- // },
1221
- // {
1222
- // // Identifying (name, type)
1223
- // tags: [
1224
- // 'typedef',
1225
- // 'interface',
1226
- // 'record',
1227
- // 'template',
1228
- // 'name',
1229
- // 'kind',
1230
- // 'type',
1231
- // 'alias',
1232
- // 'external',
1233
- // 'host',
1234
- // 'callback',
1235
- // 'func',
1236
- // 'function',
1237
- // 'method',
1238
- // 'class',
1239
- // 'constructor',
1240
- // ],
1241
- // },
1242
- // {
1243
- // // Relationships
1244
- // tags: [
1245
- // 'modifies',
1246
- // 'mixes',
1247
- // 'mixin',
1248
- // 'mixinClass',
1249
- // 'mixinFunction',
1250
- // 'namespace',
1251
- // 'borrows',
1252
- // 'constructs',
1253
- // 'lends',
1254
- // 'implements',
1255
- // 'requires',
1256
- // ],
1257
- // },
1258
- // {
1259
- // // Long descriptions
1260
- // tags: ['desc', 'description', 'classdesc', 'tutorial', 'copyright', 'license'],
1261
- // },
1262
- // {
1263
- // // Simple annotations
1264
- // tags: [
1265
- // 'const',
1266
- // 'constant',
1267
- // 'final',
1268
- // 'global',
1269
- // 'readonly',
1270
- // 'abstract',
1271
- // 'virtual',
1272
- // 'var',
1273
- // 'member',
1274
- // 'memberof',
1275
- // 'memberof!',
1276
- // 'inner',
1277
- // 'instance',
1278
- // 'inheritdoc',
1279
- // 'inheritDoc',
1280
- // 'override',
1281
- // 'hideconstructor',
1282
- // ],
1283
- // },
1284
- // {
1285
- // // Core function/object inf
1286
- // tags: ['param', 'arg', 'argument', 'prop', 'property', 'return', 'returns'],
1287
- // },
1288
- // {
1289
- // // Important behavior details
1290
- // tags: [
1291
- // 'async',
1292
- // 'generator',
1293
- // 'default',
1294
- // 'defaultvalue',
1295
- // 'enum',
1296
- // 'augments',
1297
- // 'extends',
1298
- // 'throws',
1299
- // 'exception',
1300
- // 'yield',
1301
- // 'yields',
1302
- // 'event',
1303
- // 'fires',
1304
- // 'emits',
1305
- // 'listens',
1306
- // 'this',
1307
- // ],
1308
- // },
1309
- // {
1310
- // // Access
1311
- // tags: ['static', 'private', 'protected', 'public', 'access', 'internal', 'package'],
1312
- // },
1313
- // {
1314
- // // Other/unknown
1315
- // tags: ['-other'],
1316
- // },
1317
- // {
1318
- // // Supplementary descriptions
1319
- // tags: ['see', 'example'],
1320
- // },
1321
- // {
1322
- // // Other Closure (undocumented) metadata
1323
- // tags: [
1324
- // 'closurePrimitive',
1325
- // 'customElement',
1326
- // 'expose',
1327
- // 'hidden',
1328
- // 'idGenerator',
1329
- // 'meaning',
1330
- // 'ngInject',
1331
- // 'owner',
1332
- // 'wizaction',
1333
- // ],
1334
- // },
1335
- // {
1336
- // // Other Closure (documented) metadata
1337
- // tags: [
1338
- // 'define',
1339
- // 'dict',
1340
- // 'export',
1341
- // 'externs',
1342
- // 'implicitCast',
1343
- // 'noalias',
1344
- // 'nocollapse',
1345
- // 'nocompile',
1346
- // 'noinline',
1347
- // 'nosideeffects',
1348
- // 'polymer',
1349
- // 'polymerBehavior',
1350
- // 'preserve',
1351
- // 'struct',
1352
- // 'suppress',
1353
- // 'unrestricted',
1354
- // ],
1355
- // },
1356
- // {
1357
- // // Metadata
1358
- // tags: ['category'],
1359
- // },
1360
- // {
1361
- // // Non-Closure metadata
1362
- // tags: [
1363
- // 'ignore',
1364
- // 'author',
1365
- // 'version',
1366
- // 'variation',
1367
- // 'since',
1368
- // 'deprecated',
1369
- // 'compatibility',
1370
- // 'todo',
1371
- // ],
1372
- // },
1373
- // ],
1374
- // alphabetizeExtras: true,
1375
- // linesBetween: 1,
1376
- // },
1377
- // ],
1378
1199
  "jsdoc/check-access": "warn",
1379
1200
  "jsdoc/implements-on-classes": "warn",
1380
1201
  "jsdoc/require-param-name": "warn",
@@ -1393,7 +1214,7 @@ var jsdoc = (options = {}) => [
1393
1214
  ];
1394
1215
 
1395
1216
  // src/configs/jsonc.ts
1396
- var jsonc = (options = {}) => [
1217
+ var configJsonc = (options = {}) => [
1397
1218
  {
1398
1219
  name: "ntnyq/jsonc",
1399
1220
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
@@ -1438,7 +1259,7 @@ var jsonc = (options = {}) => [
1438
1259
  ];
1439
1260
 
1440
1261
  // src/configs/pinia.ts
1441
- var pinia = (options = {}) => {
1262
+ var configPinia = (options = {}) => {
1442
1263
  const { files = [GLOB_PINIA_STORE] } = options;
1443
1264
  return [
1444
1265
  {
@@ -1470,7 +1291,7 @@ var pinia = (options = {}) => {
1470
1291
 
1471
1292
  // src/configs/ntnyq.ts
1472
1293
  import { createConfig as createNtnyqConfig } from "eslint-plugin-ntnyq";
1473
- var ntnyq = (options = {}) => [
1294
+ var configNtnyq = (options = {}) => [
1474
1295
  {
1475
1296
  ...createNtnyqConfig({
1476
1297
  rules: {
@@ -1484,7 +1305,7 @@ var ntnyq = (options = {}) => [
1484
1305
  ];
1485
1306
 
1486
1307
  // src/configs/depend.ts
1487
- var depend = (options = {}) => {
1308
+ var configDepend = (options = {}) => {
1488
1309
  const {
1489
1310
  files = [GLOB_SRC],
1490
1311
  // check package.json file
@@ -1525,12 +1346,12 @@ var depend = (options = {}) => {
1525
1346
  };
1526
1347
 
1527
1348
  // src/configs/regexp.ts
1528
- var regexp = (options = {}) => {
1349
+ var configRegexp = (options = {}) => {
1529
1350
  const recommendedConfig = pluginRegexp.configs["flat/recommended"];
1530
1351
  const recommendedRules2 = {
1531
1352
  ...recommendedConfig.rules
1532
1353
  };
1533
- if (options.severity || options.level === "warn") {
1354
+ if (options.severity === "warn") {
1534
1355
  for (const key in recommendedRules2) {
1535
1356
  if (recommendedRules2[key] === "error") {
1536
1357
  recommendedRules2[key] = "warn";
@@ -1551,7 +1372,7 @@ var regexp = (options = {}) => {
1551
1372
  };
1552
1373
 
1553
1374
  // src/configs/unocss.ts
1554
- var unocss = (options = {}) => [
1375
+ var configUnoCSS = (options = {}) => [
1555
1376
  {
1556
1377
  name: "ntnyq/unocss",
1557
1378
  plugins: {
@@ -1616,7 +1437,7 @@ var DEFAULT_PRETTIER_OPTIONS = {
1616
1437
  };
1617
1438
 
1618
1439
  // src/configs/format.ts
1619
- var format = (options = {}) => {
1440
+ var configFormat = (options = {}) => {
1620
1441
  const {
1621
1442
  css: enableCSS = true,
1622
1443
  html: enableHTML = true,
@@ -1715,8 +1536,8 @@ var regexper = defineCommand({
1715
1536
  // @regexper https://regexper.com/#%2F(%5Cb%7C%5Cs%7C%5E)(%40regexper)(%5Cs%5CS%2B)%3F(%5Cb%7C%5Cs%7C%24)%2F
1716
1537
  match: /(\b|\s|^)(@regexper)(\s\S+)?(\b|\s|$)/,
1717
1538
  action(ctx) {
1718
- const literal = ctx.findNodeBelow((node2) => {
1719
- return node2.type === "Literal" && "regex" in node2;
1539
+ const literal = ctx.findNodeBelow((node) => {
1540
+ return node.type === "Literal" && "regex" in node;
1720
1541
  });
1721
1542
  if (!literal) {
1722
1543
  return ctx.reportError("Unable to find a regexp literal to generate");
@@ -1754,7 +1575,7 @@ var regexper = defineCommand({
1754
1575
  var commands = [regexper];
1755
1576
 
1756
1577
  // src/configs/command.ts
1757
- var command = (options = {}) => [
1578
+ var configCommand = (options = {}) => [
1758
1579
  {
1759
1580
  ...createCommandConfig({
1760
1581
  ...options,
@@ -1772,7 +1593,7 @@ var command = (options = {}) => [
1772
1593
  ];
1773
1594
 
1774
1595
  // src/configs/ignores.ts
1775
- var ignores = (customIgnores = []) => [
1596
+ var configIgnores = (customIgnores = []) => [
1776
1597
  {
1777
1598
  name: "ntnyq/ignores",
1778
1599
  ignores: [
@@ -1784,7 +1605,7 @@ var ignores = (customIgnores = []) => [
1784
1605
  ];
1785
1606
 
1786
1607
  // src/configs/importX.ts
1787
- var importX = (options = {}) => {
1608
+ var configImportX = (options = {}) => {
1788
1609
  const {
1789
1610
  typescript: enableTypeScript,
1790
1611
  // use typescript resolve if possible
@@ -1818,6 +1639,7 @@ var importX = (options = {}) => {
1818
1639
  "import-x/no-duplicates": "error",
1819
1640
  "import-x/no-mutable-exports": "error",
1820
1641
  "import-x/newline-after-import": "error",
1642
+ "import-x/consistent-type-specifier-style": ["error", "prefer-top-level"],
1821
1643
  // Overrides rules
1822
1644
  ...options.overrides
1823
1645
  }
@@ -1836,7 +1658,7 @@ var disabledRules2 = {
1836
1658
  */
1837
1659
  "unicorn/prefer-global-this": "off"
1838
1660
  };
1839
- var unicorn = (options = {}) => [
1661
+ var configUnicorn = (options = {}) => [
1840
1662
  {
1841
1663
  name: "ntnyq/unicorn",
1842
1664
  plugins: {
@@ -1918,10 +1740,10 @@ var unicorn = (options = {}) => [
1918
1740
 
1919
1741
  // src/configs/specials.ts
1920
1742
  import globals from "globals";
1921
- var specials = (options = {}) => {
1743
+ var configSpecials = (options = {}) => {
1922
1744
  const {
1923
1745
  // Enable shadcn-vue support
1924
- shadcnVue: enableShadcnVue = hasShadcnVue
1746
+ shadcnVue: enableShadcnVue = hasShadcnVue()
1925
1747
  } = options;
1926
1748
  const configs2 = [
1927
1749
  {
@@ -1968,7 +1790,7 @@ var specials = (options = {}) => {
1968
1790
  files: [`**/*.config*.${GLOB_SRC_EXT}`],
1969
1791
  plugins: {
1970
1792
  "import-x": default16,
1971
- perfectionist: default19
1793
+ perfectionist: default20
1972
1794
  },
1973
1795
  rules: {
1974
1796
  "no-console": "off",
@@ -1993,6 +1815,8 @@ var specials = (options = {}) => {
1993
1815
  name: "ntnyq/specials/shadcn-vue",
1994
1816
  files: shadcnOptions.files || ["**/components/ui/**/*.ts", "**/components/ui/**/*.vue"],
1995
1817
  rules: {
1818
+ "vue/define-emits-declaration": "off",
1819
+ "import-x/consistent-type-specifier-style": "off",
1996
1820
  "@typescript-eslint/no-unused-vars": "off",
1997
1821
  "@typescript-eslint/consistent-type-imports": "off",
1998
1822
  // Overrides rules
@@ -2006,25 +1830,8 @@ var specials = (options = {}) => {
2006
1830
  return configs2;
2007
1831
  };
2008
1832
 
2009
- // src/configs/comments.ts
2010
- var comments = (options = {}) => [
2011
- {
2012
- name: "ntnyq/eslint-comments",
2013
- plugins: {
2014
- "@eslint-community/eslint-comments": default21
2015
- },
2016
- rules: {
2017
- ...default21.configs.recommended.rules,
2018
- "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
2019
- // Overrides rules
2020
- ...options.overrides
2021
- }
2022
- }
2023
- ];
2024
-
2025
1833
  // src/configs/markdown.ts
2026
- var markdown = (options = {}) => {
2027
- if (!Array.isArray(default8.configs?.processor)) return [];
1834
+ var configMarkdown = (options = {}) => {
2028
1835
  const {
2029
1836
  /**
2030
1837
  * code block files
@@ -2118,7 +1925,7 @@ var markdown = (options = {}) => {
2118
1925
  };
2119
1926
 
2120
1927
  // src/configs/prettier.ts
2121
- var prettier = (options = {}) => {
1928
+ var configPrettier = (options = {}) => {
2122
1929
  const {
2123
1930
  disabledFiles = [GLOB_SVG, GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
2124
1931
  // User defined disabled files
@@ -2169,7 +1976,7 @@ var prettier = (options = {}) => {
2169
1976
  "vue/space-unary-ops": "off",
2170
1977
  "vue/template-curly-spacing": "off",
2171
1978
  ...default17.configs.recommended.rules,
2172
- "prettier/prettier": options.severity || options.level || "warn",
1979
+ "prettier/prettier": options.severity || "warn",
2173
1980
  // Overrides rules
2174
1981
  ...options.overrides
2175
1982
  }
@@ -2190,29 +1997,9 @@ var prettier = (options = {}) => {
2190
1997
  ];
2191
1998
  };
2192
1999
 
2193
- // src/configs/stylistic.ts
2194
- var stylistic = async (options = {}) => {
2195
- await ensurePackages(["@stylistic/eslint-plugin"]);
2196
- const pluginStylistic = await interopDefault(import("@stylistic/eslint-plugin"));
2197
- return [
2198
- {
2199
- name: "ntnyq/stylistic",
2200
- plugins: {
2201
- "@stylistic": pluginStylistic
2202
- },
2203
- rules: {
2204
- // Only rules are not conflicted with Prettier
2205
- // Use stylistic config to provide type support
2206
- // Overrides rules
2207
- ...options.overrides
2208
- }
2209
- }
2210
- ];
2211
- };
2212
-
2213
2000
  // src/configs/gitignore.ts
2214
2001
  import createGitIgnoreConfig from "eslint-config-flat-gitignore";
2215
- var gitignore = (options = {}) => {
2002
+ var configGitIgnore = (options = {}) => {
2216
2003
  options.strict ??= false;
2217
2004
  return [
2218
2005
  {
@@ -2247,7 +2034,7 @@ var strictRules = {
2247
2034
  }
2248
2035
  ]
2249
2036
  };
2250
- var javascript = (options = {}) => [
2037
+ var configJavaScript = (options = {}) => [
2251
2038
  {
2252
2039
  ...jsConfig.configs.recommended,
2253
2040
  name: "ntnyq/js/recommended"
@@ -2439,7 +2226,7 @@ var javascript = (options = {}) => [
2439
2226
  }
2440
2227
  }
2441
2228
  ];
2442
- var jsx = () => [
2229
+ var configJSX = () => [
2443
2230
  {
2444
2231
  name: "ntnyq/jsx",
2445
2232
  files: ["**/*.jsx"],
@@ -2490,7 +2277,7 @@ var typeAwareRules = {
2490
2277
  var recommendedRules = configs.recommended.reduce((rules, config) => {
2491
2278
  return { ...rules, ...config.rules || {} };
2492
2279
  }, {});
2493
- var typescript = (options = {}) => {
2280
+ var configTypeScript = (options = {}) => {
2494
2281
  const enableTypeAwareLint = !!options?.tsconfigPath;
2495
2282
  const {
2496
2283
  extensions = [],
@@ -2505,7 +2292,7 @@ var typescript = (options = {}) => {
2505
2292
  // Enable typescript in these exts
2506
2293
  ...extensions.map((ext) => `**/*.${ext}`)
2507
2294
  ];
2508
- function createParserConfig(enableTypeAware = false, files2 = [], ignores2 = []) {
2295
+ function createParserConfig(enableTypeAware = false, files2 = [], ignores = []) {
2509
2296
  const typescriptParserOptions = {
2510
2297
  extraFileExtensions: extensions.map((ext) => `.${ext}`),
2511
2298
  sourceType: "module",
@@ -2521,7 +2308,7 @@ var typescript = (options = {}) => {
2521
2308
  const parserConfig = {
2522
2309
  name: `ntnyq/ts/${enableTypeAware ? "parser-type-aware" : "parser"}`,
2523
2310
  files: files2,
2524
- ignores: [...ignores2],
2311
+ ignores: [...ignores],
2525
2312
  languageOptions: {
2526
2313
  parser: parserTypeScript,
2527
2314
  parserOptions: typescriptParserOptions
@@ -2671,7 +2458,7 @@ var typescript = (options = {}) => {
2671
2458
  };
2672
2459
 
2673
2460
  // src/configs/eslintPlugin.ts
2674
- var eslintPlugin = async (options = {}) => {
2461
+ var configESLintPlugin = async (options = {}) => {
2675
2462
  await ensurePackages(["eslint-plugin-eslint-plugin"]);
2676
2463
  const pluginESLintPlugin = await interopDefault(import("eslint-plugin-eslint-plugin"));
2677
2464
  return [
@@ -2691,7 +2478,7 @@ var eslintPlugin = async (options = {}) => {
2691
2478
 
2692
2479
  // src/configs/githubAction.ts
2693
2480
  import { createConfig } from "eslint-plugin-github-action";
2694
- var githubAction = (options = {}) => {
2481
+ var configGitHubAction = (options = {}) => {
2695
2482
  const {
2696
2483
  // Support common overrides rules
2697
2484
  overrides: overridesRules = {},
@@ -2714,7 +2501,7 @@ var githubAction = (options = {}) => {
2714
2501
  };
2715
2502
 
2716
2503
  // src/configs/perfectionist.ts
2717
- var sharedGroupsForInterfaceOrObjectTypes = [
2504
+ var INTERFACE_OR_OBJECT_TYPES_GROUPS = [
2718
2505
  "required-property",
2719
2506
  "optional-property",
2720
2507
  "required-method",
@@ -2727,7 +2514,7 @@ var sharedGroupsForInterfaceOrObjectTypes = [
2727
2514
  "index-signature",
2728
2515
  "multiline-index-signature"
2729
2516
  ];
2730
- var sharedGroupsForIntersectionOrUnion = [
2517
+ var INTERSECTION_OR_UNION_TYPES_GROUPS = [
2731
2518
  /**
2732
2519
  * eg. 'foobar', 24, false
2733
2520
  */
@@ -2777,26 +2564,34 @@ var sharedGroupsForIntersectionOrUnion = [
2777
2564
  */
2778
2565
  "nullish"
2779
2566
  ];
2780
- var defaultSortInterfacesGroups = [...sharedGroupsForInterfaceOrObjectTypes];
2781
- var defaultSortObjectTypesGroups = [...sharedGroupsForInterfaceOrObjectTypes];
2782
- var defaultSortIntersectionTypesGroups = [...sharedGroupsForIntersectionOrUnion];
2783
- var defaultSortUnionTypesGroups = [...sharedGroupsForIntersectionOrUnion];
2784
- var perfectionist = (options = {}) => {
2567
+ var configPerfectionist = (options = {}) => {
2785
2568
  const {
2786
2569
  sortEnums: enableSortEnums = true,
2787
2570
  sortTypes: enableSortTypes = true,
2788
- sortConstants: enableSortConstants = true
2571
+ sortConstants: enableSortConstants = true,
2572
+ partitionByComment = ["@pg", "@perfectionist-group"]
2789
2573
  } = options;
2574
+ function getCommonRuleOptions(options2 = {}) {
2575
+ const ruleOptions = {
2576
+ type: "alphabetical",
2577
+ order: "asc",
2578
+ ignoreCase: true,
2579
+ ...options2.disableNewlinesBetween ? {} : { newlinesBetween: "ignore" },
2580
+ ...options2.disableNewlinesBetween ? {} : { partitionByComment }
2581
+ };
2582
+ return ruleOptions;
2583
+ }
2790
2584
  const configs2 = [
2791
2585
  {
2792
2586
  name: "ntnyq/perfectionist/common",
2793
2587
  plugins: {
2794
- perfectionist: default19
2588
+ perfectionist: default20
2795
2589
  },
2796
2590
  rules: {
2797
2591
  "perfectionist/sort-imports": [
2798
2592
  "error",
2799
2593
  {
2594
+ ...getCommonRuleOptions(),
2800
2595
  groups: [
2801
2596
  // Side effect style imports (e.g. 'normalize.css')
2802
2597
  "side-effect-style",
@@ -2833,42 +2628,37 @@ var perfectionist = (options = {}) => {
2833
2628
  */
2834
2629
  "unknown"
2835
2630
  ],
2836
- order: "asc",
2837
- type: "natural",
2838
- ignoreCase: true,
2839
- internalPattern: ["^~/.+", "^@/.+", "^#.+"],
2840
- newlinesBetween: "ignore",
2841
- partitionByComment: true
2631
+ internalPattern: ["^~/.+", "^@/.+", "^#.+"]
2842
2632
  }
2843
2633
  ],
2844
2634
  "perfectionist/sort-exports": [
2845
2635
  "error",
2846
2636
  {
2847
- order: "asc",
2637
+ ...getCommonRuleOptions({
2638
+ disableNewlinesBetween: true
2639
+ }),
2848
2640
  type: "line-length",
2849
- groupKind: "values-first",
2850
- partitionByComment: true
2641
+ groupKind: "values-first"
2851
2642
  }
2852
2643
  ],
2853
2644
  "perfectionist/sort-named-exports": [
2854
2645
  "error",
2855
2646
  {
2856
- type: "alphabetical",
2857
- order: "asc",
2858
- ignoreCase: true,
2859
- groupKind: "values-first",
2860
- partitionByComment: true
2647
+ ...getCommonRuleOptions({
2648
+ disableNewlinesBetween: true
2649
+ }),
2650
+ ignoreAlias: false,
2651
+ groupKind: "values-first"
2861
2652
  }
2862
2653
  ],
2863
2654
  "perfectionist/sort-named-imports": [
2864
2655
  "error",
2865
2656
  {
2866
- type: "alphabetical",
2867
- order: "asc",
2868
- ignoreCase: true,
2657
+ ...getCommonRuleOptions({
2658
+ disableNewlinesBetween: true
2659
+ }),
2869
2660
  ignoreAlias: false,
2870
- groupKind: "values-first",
2871
- partitionByComment: true
2661
+ groupKind: "values-first"
2872
2662
  }
2873
2663
  ],
2874
2664
  // Overrides rules
@@ -2881,23 +2671,19 @@ var perfectionist = (options = {}) => {
2881
2671
  name: "ntnyq/perfectionist/enums",
2882
2672
  files: [`**/enums/${GLOB_SRC}`, `**/enums.${GLOB_SRC_EXT}`],
2883
2673
  plugins: {
2884
- perfectionist: default19
2674
+ perfectionist: default20
2885
2675
  },
2886
2676
  rules: {
2887
2677
  "perfectionist/sort-enums": [
2888
2678
  "error",
2889
2679
  {
2890
- type: "alphabetical",
2891
- order: "asc",
2892
- partitionByComment: true
2680
+ ...getCommonRuleOptions()
2893
2681
  }
2894
2682
  ],
2895
2683
  "perfectionist/sort-modules": [
2896
2684
  "error",
2897
2685
  {
2898
- type: "alphabetical",
2899
- order: "asc",
2900
- partitionByComment: true
2686
+ ...getCommonRuleOptions()
2901
2687
  }
2902
2688
  ],
2903
2689
  // Overrides rules
@@ -2910,58 +2696,50 @@ var perfectionist = (options = {}) => {
2910
2696
  name: "ntnyq/perfectionist/types",
2911
2697
  files: [...GLOB_TYPES],
2912
2698
  plugins: {
2913
- perfectionist: default19
2699
+ perfectionist: default20
2914
2700
  },
2915
2701
  rules: {
2916
2702
  "perfectionist/sort-heritage-clauses": [
2917
2703
  "error",
2918
2704
  {
2919
- type: "alphabetical",
2920
- order: "asc"
2705
+ ...getCommonRuleOptions({
2706
+ disableNewlinesBetween: true,
2707
+ disablePartitionByComment: true
2708
+ })
2921
2709
  }
2922
2710
  ],
2923
2711
  "perfectionist/sort-interfaces": [
2924
2712
  "error",
2925
2713
  {
2926
- type: "alphabetical",
2927
- order: "asc",
2928
- partitionByComment: true,
2929
- groups: defaultSortInterfacesGroups
2714
+ ...getCommonRuleOptions(),
2715
+ groups: INTERFACE_OR_OBJECT_TYPES_GROUPS
2930
2716
  }
2931
2717
  ],
2932
2718
  "perfectionist/sort-intersection-types": [
2933
2719
  "error",
2934
2720
  {
2935
- type: "alphabetical",
2936
- order: "asc",
2937
- partitionByComment: true,
2938
- groups: defaultSortIntersectionTypesGroups
2721
+ ...getCommonRuleOptions(),
2722
+ groups: INTERSECTION_OR_UNION_TYPES_GROUPS
2939
2723
  }
2940
2724
  ],
2941
2725
  "perfectionist/sort-modules": [
2942
2726
  "error",
2943
2727
  {
2944
- type: "alphabetical",
2945
- order: "asc",
2946
- partitionByComment: true
2728
+ ...getCommonRuleOptions()
2947
2729
  }
2948
2730
  ],
2949
2731
  "perfectionist/sort-object-types": [
2950
2732
  "error",
2951
2733
  {
2952
- type: "alphabetical",
2953
- order: "asc",
2954
- partitionByComment: true,
2955
- groups: defaultSortObjectTypesGroups
2734
+ ...getCommonRuleOptions(),
2735
+ groups: INTERFACE_OR_OBJECT_TYPES_GROUPS
2956
2736
  }
2957
2737
  ],
2958
2738
  "perfectionist/sort-union-types": [
2959
2739
  "error",
2960
2740
  {
2961
- type: "alphabetical",
2962
- order: "asc",
2963
- partitionByComment: true,
2964
- groups: defaultSortUnionTypesGroups
2741
+ ...getCommonRuleOptions(),
2742
+ groups: INTERSECTION_OR_UNION_TYPES_GROUPS
2965
2743
  }
2966
2744
  ],
2967
2745
  // Overrides rules
@@ -2974,40 +2752,32 @@ var perfectionist = (options = {}) => {
2974
2752
  name: "ntnyq/perfectionist/constants",
2975
2753
  files: [`**/constants/${GLOB_SRC}`, `**/constants.${GLOB_SRC_EXT}`],
2976
2754
  plugins: {
2977
- perfectionist: default19
2755
+ perfectionist: default20
2978
2756
  },
2979
2757
  rules: {
2980
2758
  "perfectionist/sort-maps": [
2981
2759
  "error",
2982
2760
  {
2983
- type: "alphabetical",
2984
- order: "asc",
2985
- partitionByComment: true
2761
+ ...getCommonRuleOptions()
2986
2762
  }
2987
2763
  ],
2988
2764
  "perfectionist/sort-objects": [
2989
2765
  "error",
2990
2766
  {
2991
- type: "alphabetical",
2992
- order: "asc",
2993
- partitionByComment: true,
2994
- groups: ["unknown", "method", "multiline"]
2767
+ ...getCommonRuleOptions(),
2768
+ groups: ["property", "multiline-property", "method", "multiline-method", "unknown"]
2995
2769
  }
2996
2770
  ],
2997
2771
  "perfectionist/sort-sets": [
2998
2772
  "error",
2999
2773
  {
3000
- type: "alphabetical",
3001
- order: "asc",
3002
- partitionByComment: true
2774
+ ...getCommonRuleOptions()
3003
2775
  }
3004
2776
  ],
3005
2777
  "perfectionist/sort-modules": [
3006
2778
  "error",
3007
2779
  {
3008
- type: "alphabetical",
3009
- order: "asc",
3010
- partitionByComment: true
2780
+ ...getCommonRuleOptions()
3011
2781
  }
3012
2782
  ],
3013
2783
  // Overrides rules
@@ -3019,11 +2789,11 @@ var perfectionist = (options = {}) => {
3019
2789
  };
3020
2790
 
3021
2791
  // src/configs/unusedImports.ts
3022
- var unusedImports = (options = {}) => [
2792
+ var configUnusedImports = (options = {}) => [
3023
2793
  {
3024
2794
  name: "ntnyq/unused-imports",
3025
2795
  plugins: {
3026
- "unused-imports": default20
2796
+ "unused-imports": default21
3027
2797
  },
3028
2798
  rules: {
3029
2799
  "@typescript-eslint/no-unused-vars": "off",
@@ -3047,6 +2817,22 @@ var unusedImports = (options = {}) => [
3047
2817
  }
3048
2818
  ];
3049
2819
 
2820
+ // src/configs/eslintComments.ts
2821
+ var configESLintComments = (options = {}) => [
2822
+ {
2823
+ name: "ntnyq/eslint-comments",
2824
+ plugins: {
2825
+ "@eslint-community/eslint-comments": default22
2826
+ },
2827
+ rules: {
2828
+ ...default22.configs.recommended.rules,
2829
+ "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
2830
+ // Overrides rules
2831
+ ...options.overrides
2832
+ }
2833
+ }
2834
+ ];
2835
+
3050
2836
  // src/core.ts
3051
2837
  function defineESLintConfig(options = {}, ...userConfigs) {
3052
2838
  const {
@@ -3057,11 +2843,11 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3057
2843
  /**
3058
2844
  * Conditional by deps
3059
2845
  */
3060
- vue: enableVue = hasVue,
3061
- pinia: enablePinia = hasPinia,
3062
- test: enableTest = hasVitest,
3063
- unocss: enableUnoCSS = hasUnoCSS,
3064
- typescript: enableTypeScript = hasTypeScript,
2846
+ vue: enableVue = hasVue(),
2847
+ pinia: enablePinia = hasPinia(),
2848
+ test: enableTest = hasVitest(),
2849
+ unocss: enableUnoCSS = hasUnoCSS(),
2850
+ typescript: enableTypeScript = hasTypeScript(),
3065
2851
  /**
3066
2852
  * Enabled by default
3067
2853
  */
@@ -3081,7 +2867,6 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3081
2867
  perfectionist: enablePerfectionist = true,
3082
2868
  // disabled by default
3083
2869
  svgo: enableSVGO = false,
3084
- stylistic: enableStylistic = false,
3085
2870
  eslintPlugin: enableESLintPlugin = false
3086
2871
  } = options;
3087
2872
  const configs2 = [];
@@ -3089,36 +2874,36 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3089
2874
  supportedExtensions.push("vue");
3090
2875
  }
3091
2876
  if (enableGitIgnore) {
3092
- configs2.push(gitignore(resolveSubOptions(options, "gitignore")));
2877
+ configs2.push(configGitIgnore(resolveSubOptions(options, "gitignore")));
3093
2878
  }
3094
2879
  configs2.push(
3095
- ignores(options.ignores),
3096
- jsx(),
3097
- node({
2880
+ configIgnores(options.ignores),
2881
+ configJSX(),
2882
+ configNode({
3098
2883
  overrides: getOverrides(options, "node")
3099
2884
  }),
3100
- command(resolveSubOptions(options, "command")),
3101
- importX({
2885
+ configCommand(resolveSubOptions(options, "command")),
2886
+ configImportX({
3102
2887
  ...resolveSubOptions(options, "importX"),
3103
2888
  typescript: !!enableTypeScript,
3104
2889
  overrides: getOverrides(options, "importX")
3105
2890
  }),
3106
- jsdoc({
2891
+ configJsdoc({
3107
2892
  typescript: !!enableTypeScript,
3108
2893
  overrides: getOverrides(options, "jsdoc"),
3109
2894
  ...resolveSubOptions(options, "jsdoc")
3110
2895
  }),
3111
- comments({
3112
- overrides: getOverrides(options, "comments")
2896
+ configESLintComments({
2897
+ overrides: getOverrides(options, "eslintComments")
3113
2898
  }),
3114
- javascript({
2899
+ configJavaScript({
3115
2900
  ...resolveSubOptions(options, "javascript"),
3116
2901
  overrides: getOverrides(options, "javascript")
3117
2902
  })
3118
2903
  );
3119
2904
  if (enablePerfectionist) {
3120
2905
  configs2.push(
3121
- perfectionist({
2906
+ configPerfectionist({
3122
2907
  ...resolveSubOptions(options, "perfectionist"),
3123
2908
  overrides: getOverrides(options, "perfectionist")
3124
2909
  })
@@ -3126,14 +2911,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3126
2911
  }
3127
2912
  if (enableUnicorn) {
3128
2913
  configs2.push(
3129
- unicorn({
2914
+ configUnicorn({
3130
2915
  overrides: getOverrides(options, "unicorn")
3131
2916
  })
3132
2917
  );
3133
2918
  }
3134
2919
  if (enablePinia) {
3135
2920
  configs2.push(
3136
- pinia({
2921
+ configPinia({
3137
2922
  ...resolveSubOptions(options, "pinia"),
3138
2923
  overrides: getOverrides(options, "pinia")
3139
2924
  })
@@ -3141,7 +2926,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3141
2926
  }
3142
2927
  if (enableRegexp) {
3143
2928
  configs2.push(
3144
- regexp({
2929
+ configRegexp({
3145
2930
  ...resolveSubOptions(options, "regexp"),
3146
2931
  overrides: getOverrides(options, "regexp")
3147
2932
  })
@@ -3149,7 +2934,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3149
2934
  }
3150
2935
  if (enableTypeScript) {
3151
2936
  configs2.push(
3152
- typescript({
2937
+ configTypeScript({
3153
2938
  ...resolveSubOptions(options, "typescript"),
3154
2939
  extensions: supportedExtensions,
3155
2940
  overrides: getOverrides(options, "typescript")
@@ -3158,7 +2943,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3158
2943
  }
3159
2944
  if (enableVue) {
3160
2945
  configs2.push(
3161
- vue({
2946
+ configVue({
3162
2947
  ...resolveSubOptions(options, "vue"),
3163
2948
  typescript: !!enableTypeScript,
3164
2949
  overrides: getOverrides(options, "vue")
@@ -3167,48 +2952,46 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3167
2952
  }
3168
2953
  if (enableYML) {
3169
2954
  configs2.push(
3170
- yml({
2955
+ configYml({
3171
2956
  overrides: getOverrides(options, "yml")
3172
2957
  })
3173
2958
  );
3174
2959
  }
3175
2960
  if (enableTOML) {
3176
2961
  configs2.push(
3177
- toml({
2962
+ configToml({
3178
2963
  overrides: getOverrides(options, "toml")
3179
2964
  })
3180
2965
  );
3181
2966
  }
3182
2967
  if (enableJSONC) {
3183
2968
  configs2.push(
3184
- jsonc({
2969
+ configJsonc({
3185
2970
  overrides: getOverrides(options, "jsonc")
3186
2971
  })
3187
2972
  );
3188
2973
  }
3189
2974
  if (enableSort) {
3190
- configs2.push(sort(resolveSubOptions(options, "sort")));
2975
+ configs2.push(configSort(resolveSubOptions(options, "sort")));
3191
2976
  }
3192
2977
  if (enableTest) {
3193
2978
  configs2.push(
3194
- test({
3195
- overrides: getOverrides(options, "test")
3196
- }),
3197
- vitest({
2979
+ configTest({
2980
+ ...resolveSubOptions(options, "test"),
3198
2981
  overrides: getOverrides(options, "test")
3199
2982
  })
3200
2983
  );
3201
2984
  }
3202
2985
  if (enableUnoCSS) {
3203
2986
  configs2.push(
3204
- unocss({
2987
+ configUnoCSS({
3205
2988
  overrides: getOverrides(options, "unocss")
3206
2989
  })
3207
2990
  );
3208
2991
  }
3209
2992
  if (enableMarkdown) {
3210
2993
  configs2.push(
3211
- markdown({
2994
+ configMarkdown({
3212
2995
  ...resolveSubOptions(options, "markdown"),
3213
2996
  extensions: supportedExtensions,
3214
2997
  overrides: getOverrides(options, "markdown")
@@ -3217,14 +3000,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3217
3000
  }
3218
3001
  if (enableAntfu) {
3219
3002
  configs2.push(
3220
- antfu({
3003
+ configAntfu({
3221
3004
  overrides: getOverrides(options, "antfu")
3222
3005
  })
3223
3006
  );
3224
3007
  }
3225
3008
  if (enableDepend) {
3226
3009
  configs2.push(
3227
- depend({
3010
+ configDepend({
3228
3011
  ...resolveSubOptions(options, "depend"),
3229
3012
  overrides: getOverrides(options, "depend")
3230
3013
  })
@@ -3232,45 +3015,38 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3232
3015
  }
3233
3016
  if (enableNtnyq) {
3234
3017
  configs2.push(
3235
- ntnyq({
3018
+ configNtnyq({
3236
3019
  overrides: getOverrides(options, "ntnyq")
3237
3020
  })
3238
3021
  );
3239
3022
  }
3240
3023
  if (enableGitHubAction) {
3241
3024
  configs2.push(
3242
- githubAction({
3025
+ configGitHubAction({
3243
3026
  overrides: getOverrides(options, "githubAction")
3244
3027
  })
3245
3028
  );
3246
3029
  }
3247
3030
  if (enableESLintPlugin) {
3248
3031
  configs2.push(
3249
- eslintPlugin({
3032
+ configESLintPlugin({
3250
3033
  overrides: getOverrides(options, "eslintPlugin")
3251
3034
  })
3252
3035
  );
3253
3036
  }
3254
- if (enableStylistic) {
3255
- configs2.push(
3256
- stylistic({
3257
- overrides: getOverrides(options, "stylistic")
3258
- })
3259
- );
3260
- }
3261
3037
  if (enableSVGO) {
3262
- configs2.push(svgo(resolveSubOptions(options, "svgo")));
3038
+ configs2.push(configSVGO(resolveSubOptions(options, "svgo")));
3263
3039
  }
3264
- const configSpecials = specials(resolveSubOptions(options, "specials"));
3265
- const configPrettier = enablePrettier ? prettier({
3040
+ const specialsConfigs = configSpecials(resolveSubOptions(options, "specials"));
3041
+ const prettierConfigs = enablePrettier ? configPrettier({
3266
3042
  ...resolveSubOptions(options, "prettier"),
3267
3043
  overrides: getOverrides(options, "prettier")
3268
3044
  }) : [];
3269
3045
  const composer = new FlatConfigComposer(
3270
3046
  ...configs2,
3271
3047
  ...userConfigs,
3272
- ...configSpecials,
3273
- ...configPrettier
3048
+ ...specialsConfigs,
3049
+ ...prettierConfigs
3274
3050
  );
3275
3051
  return composer;
3276
3052
  }
@@ -3312,59 +3088,73 @@ export {
3312
3088
  GLOB_TYPES,
3313
3089
  GLOB_VUE,
3314
3090
  GLOB_YAML,
3315
- antfu,
3316
3091
  combineConfigs,
3317
- command,
3318
- comments,
3092
+ configAntfu,
3093
+ configCommand,
3094
+ configDepend,
3095
+ configESLintComments,
3096
+ configESLintPlugin,
3097
+ configFormat,
3098
+ configGitHubAction,
3099
+ configGitIgnore,
3100
+ configIgnores,
3101
+ configImportX,
3102
+ configJSX,
3103
+ configJavaScript,
3104
+ configJsdoc,
3105
+ configJsonc,
3106
+ configMarkdown,
3107
+ configNode,
3108
+ configNtnyq,
3109
+ configPerfectionist,
3110
+ configPinia,
3111
+ configPrettier,
3112
+ configRegexp,
3113
+ configSVGO,
3114
+ configSort,
3115
+ configSpecials,
3116
+ configTest,
3117
+ configToml,
3118
+ configTypeScript,
3119
+ configUnicorn,
3120
+ configUnoCSS,
3121
+ configUnusedImports,
3122
+ configVue,
3123
+ configYml,
3124
+ configs as configsTypescript,
3319
3125
  createNodeResolver,
3320
3126
  createTypeScriptImportResolver,
3321
3127
  defineESLintConfig,
3322
- depend,
3323
3128
  ensurePackages,
3324
- esX,
3325
- eslintPlugin,
3326
- format,
3327
3129
  getOverrides,
3328
- githubAction,
3329
- gitignore,
3330
3130
  hasPinia,
3331
3131
  hasShadcnVue,
3332
3132
  hasTypeScript,
3333
3133
  hasUnoCSS,
3334
3134
  hasVitest,
3335
3135
  hasVue,
3336
- ignores,
3337
- importX,
3338
3136
  interopDefault,
3339
3137
  isInGitHooksOrRunByNanoStagedOrRunByTSX,
3340
- javascript,
3341
- jsdoc,
3342
- jsonc,
3343
- jsx,
3344
- markdown,
3345
3138
  mergePrettierOptions,
3346
3139
  mergeProcessors,
3347
- node,
3348
- ntnyq,
3349
3140
  parserJsonc,
3350
3141
  parserPlain,
3351
3142
  parserToml,
3352
3143
  parserTypeScript,
3353
3144
  parserVue,
3354
3145
  parserYaml,
3355
- perfectionist,
3356
- pinia,
3357
3146
  default9 as pluginAntfu,
3358
- default21 as pluginComments,
3147
+ default22 as pluginComments,
3359
3148
  pluginDepend,
3360
3149
  default12 as pluginFormat,
3361
- default18 as pluginGitHubAction,
3150
+ default19 as pluginGitHubAction,
3362
3151
  default16 as pluginImportX,
3363
3152
  default10 as pluginJsdoc,
3364
3153
  default11 as pluginJsonc,
3365
3154
  default8 as pluginMarkdown,
3155
+ default18 as pluginNoOnlyTests,
3366
3156
  default2 as pluginNode,
3367
- default19 as pluginPerfectionist,
3157
+ default20 as pluginPerfectionist,
3368
3158
  default7 as pluginPinia,
3369
3159
  default17 as pluginPrettier,
3370
3160
  pluginRegexp,
@@ -3373,28 +3163,12 @@ export {
3373
3163
  plugin as pluginTypeScript,
3374
3164
  default15 as pluginUnicorn,
3375
3165
  default13 as pluginUnoCSS,
3376
- default20 as pluginUnusedImports,
3166
+ default21 as pluginUnusedImports,
3377
3167
  default14 as pluginVitest,
3378
3168
  default3 as pluginVue,
3379
- default4 as pluginYaml,
3380
- prettier,
3169
+ default4 as pluginYml,
3381
3170
  processorPassThrough,
3382
- default22 as processorVueBlocks,
3383
- regexp,
3171
+ default23 as processorVueBlocks,
3384
3172
  resolveSubOptions,
3385
- sort,
3386
- specials,
3387
- stylistic,
3388
- svgo,
3389
- test,
3390
- toArray,
3391
- toml,
3392
- typescript,
3393
- configs as typescriptConfigs,
3394
- unicorn,
3395
- unocss,
3396
- unusedImports,
3397
- vitest,
3398
- vue,
3399
- yml
3173
+ toArray
3400
3174
  };