@ntnyq/eslint-config 3.11.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.js CHANGED
@@ -37,40 +37,37 @@ import * as pluginRegexp from "eslint-plugin-regexp";
37
37
  import * as pluginDepend from "eslint-plugin-depend";
38
38
  import { default as default2 } from "eslint-plugin-n";
39
39
  import { default as default3 } from "eslint-plugin-vue";
40
- import { default as default4 } from "eslint-plugin-es-x";
41
- import { default as default5 } from "eslint-plugin-yml";
42
- import { default as default6 } from "eslint-plugin-svgo";
43
- import { default as default7 } from "eslint-plugin-toml";
44
- import { default as default8 } from "eslint-plugin-pinia";
45
- import { default as default9 } from "eslint-plugin-ntnyq";
46
- import { default as default10 } from "@eslint/markdown";
47
- import { default as default11 } from "eslint-plugin-antfu";
48
- import { default as default12 } from "eslint-plugin-jsdoc";
49
- import { default as default13 } from "eslint-plugin-jsonc";
40
+ import { default as default4 } from "eslint-plugin-yml";
41
+ import { default as default5 } from "eslint-plugin-svgo";
42
+ import { default as default6 } from "eslint-plugin-toml";
43
+ import { default as default7 } from "eslint-plugin-pinia";
44
+ import { default as default8 } from "@eslint/markdown";
45
+ import { default as default9 } from "eslint-plugin-antfu";
46
+ import { default as default10 } from "eslint-plugin-jsdoc";
47
+ import { default as default11 } from "eslint-plugin-jsonc";
50
48
  import { plugin } from "typescript-eslint";
51
- import { default as default14 } from "eslint-plugin-format";
52
- import { default as default15 } from "@unocss/eslint-plugin";
53
- import { default as default16 } from "@vitest/eslint-plugin";
54
- import { default as default17 } from "eslint-plugin-unicorn";
55
- import { default as default18 } from "eslint-plugin-import-x";
56
- import { default as default19 } from "eslint-plugin-prettier";
57
- import { default as default20 } from "@stylistic/eslint-plugin";
58
- import { default as default21 } from "eslint-plugin-github-action";
59
- import { default as default22 } from "eslint-plugin-perfectionist";
60
- import { default as default23 } from "eslint-plugin-unused-imports";
61
- import { default as default24 } from "@eslint-community/eslint-plugin-eslint-comments";
49
+ import { default as default12 } from "eslint-plugin-format";
50
+ import { default as default13 } from "@unocss/eslint-plugin";
51
+ import { default as default14 } from "@vitest/eslint-plugin";
52
+ import { default as default15 } from "eslint-plugin-unicorn";
53
+ import { default as default16 } from "eslint-plugin-import-x";
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";
62
59
 
63
60
  // src/eslint/configs.ts
64
61
  import { configs } from "typescript-eslint";
65
62
 
66
63
  // src/eslint/resolvers.ts
67
64
  import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
68
- var createNodeResolver = default18.createNodeResolver;
65
+ var createNodeResolver = default16.createNodeResolver;
69
66
 
70
67
  // src/eslint/processors.ts
71
68
  import { mergeProcessors } from "eslint-merge-processors";
72
69
  import { processorPassThrough } from "eslint-merge-processors";
73
- import { default as default25 } from "eslint-processor-vue-blocks";
70
+ import { default as default22 } from "eslint-processor-vue-blocks";
74
71
 
75
72
  // src/globs.ts
76
73
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
@@ -171,7 +168,11 @@ var GLOB_EXCLUDE = [
171
168
  "**/.wrangler",
172
169
  "**/.changeset",
173
170
  "**/.npmrc",
174
- "**/.yarnrc"
171
+ "**/.yarnrc",
172
+ "**/.husky",
173
+ // tauri
174
+ "**/src-tauri/gen",
175
+ "**/src-tauri/target"
175
176
  ];
176
177
 
177
178
  // src/configs/vue.ts
@@ -382,7 +383,7 @@ var vue = (options = {}) => {
382
383
  if (!sfcBlocks) return processorVueSFC;
383
384
  return mergeProcessors2([
384
385
  processorVueSFC,
385
- default25({
386
+ default22({
386
387
  ...sfcBlocks,
387
388
  blocks: {
388
389
  styles: true,
@@ -537,11 +538,11 @@ var yml = (options = {}) => [
537
538
  parser: parserYaml
538
539
  },
539
540
  plugins: {
540
- yml: default5
541
+ yml: default4
541
542
  },
542
543
  rules: {
543
- ...default5.configs.standard.rules,
544
- ...default5.configs.prettier.rules,
544
+ ...default4.configs.standard.rules,
545
+ ...default4.configs.prettier.rules,
545
546
  "yml/no-empty-mapping-value": "off",
546
547
  "yml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
547
548
  // Overrides rules
@@ -550,19 +551,123 @@ var yml = (options = {}) => [
550
551
  }
551
552
  ];
552
553
 
553
- // src/configs/esX.ts
554
- var esX = (options = {}) => [
555
- {
556
- name: "ntnyq/es-x",
557
- plugins: {
558
- "es-x": default4
559
- },
560
- rules: {
561
- // Overrides rules
562
- ...options.overrides
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);
563
629
  }
564
630
  }
565
- ];
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
+ };
566
671
 
567
672
  // src/configs/node.ts
568
673
  var node = (options = {}) => [
@@ -936,7 +1041,7 @@ var toml = (options = {}) => [
936
1041
  parser: parserToml
937
1042
  },
938
1043
  plugins: {
939
- toml: default7
1044
+ toml: default6
940
1045
  },
941
1046
  rules: {
942
1047
  "toml/keys-order": "error",
@@ -978,13 +1083,13 @@ var test = (options = {}) => [
978
1083
  }
979
1084
  ];
980
1085
  var vitest = (options = {}) => {
981
- if (!default16.configs?.recommended) return [];
982
- const vitestConfigs = default16.configs;
1086
+ if (!default14.configs?.recommended) return [];
1087
+ const vitestConfigs = default14.configs;
983
1088
  return [
984
1089
  {
985
1090
  name: "ntnyq/vitest",
986
1091
  plugins: {
987
- vitest: default16
1092
+ vitest: default14
988
1093
  },
989
1094
  files: [...GLOB_TEST],
990
1095
  rules: {
@@ -997,20 +1102,27 @@ var vitest = (options = {}) => {
997
1102
  };
998
1103
 
999
1104
  // src/configs/svgo.ts
1000
- import { config as createSVGOConfig } from "eslint-plugin-svgo";
1001
- var svgo = (options = {}) => [
1002
- {
1003
- ...createSVGOConfig(options),
1004
- name: "ntnyq/svgo"
1005
- }
1006
- ];
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
+ };
1007
1119
 
1008
1120
  // src/configs/antfu.ts
1009
1121
  var antfu = (options = {}) => [
1010
1122
  {
1011
1123
  name: "ntnyq/antfu",
1012
1124
  plugins: {
1013
- antfu: default11
1125
+ antfu: default9
1014
1126
  },
1015
1127
  rules: {
1016
1128
  // required `object-curly-newline` to be disabled
@@ -1026,6 +1138,13 @@ var antfu = (options = {}) => [
1026
1138
  ];
1027
1139
 
1028
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
+ };
1029
1148
  var typescriptRules = {
1030
1149
  "jsdoc/no-undefined-types": "off",
1031
1150
  "jsdoc/require-param-type": "off",
@@ -1037,7 +1156,7 @@ var jsdoc = (options = {}) => [
1037
1156
  {
1038
1157
  name: "ntnyq/jsdoc",
1039
1158
  plugins: {
1040
- jsdoc: default12
1159
+ jsdoc: default10
1041
1160
  },
1042
1161
  rules: {
1043
1162
  // Disabled rules
@@ -1046,20 +1165,33 @@ var jsdoc = (options = {}) => [
1046
1165
  "jsdoc/text-escaping": "off",
1047
1166
  // No need
1048
1167
  // Fixable rules
1049
- "jsdoc/check-alignment": "error",
1050
- "jsdoc/check-line-alignment": "error",
1051
- "jsdoc/check-param-names": "error",
1052
- "jsdoc/check-property-names": "error",
1053
- "jsdoc/check-types": "error",
1054
1168
  "jsdoc/empty-tags": "error",
1055
- "jsdoc/multiline-blocks": "error",
1056
- "jsdoc/no-bad-blocks": "error",
1057
- "jsdoc/no-blank-block-descriptions": "error",
1058
- "jsdoc/no-blank-blocks": "error",
1059
1169
  "jsdoc/no-defaults": "error",
1170
+ "jsdoc/check-types": "error",
1171
+ "jsdoc/no-blank-blocks": "error",
1172
+ "jsdoc/check-alignment": "error",
1173
+ "jsdoc/multiline-blocks": "error",
1174
+ "jsdoc/check-param-names": "error",
1060
1175
  "jsdoc/no-multi-asterisks": "error",
1176
+ "jsdoc/check-line-alignment": "error",
1177
+ "jsdoc/check-property-names": "error",
1061
1178
  "jsdoc/require-asterisk-prefix": "error",
1179
+ "jsdoc/no-blank-block-descriptions": "error",
1062
1180
  "jsdoc/require-hyphen-before-param-description": "error",
1181
+ "jsdoc/no-bad-blocks": [
1182
+ "error",
1183
+ {
1184
+ ignore: [
1185
+ // built-in default
1186
+ "ts-check",
1187
+ "ts-expect-error",
1188
+ "ts-ignore",
1189
+ "ts-nocheck",
1190
+ // useful
1191
+ "vite-ignore"
1192
+ ]
1193
+ }
1194
+ ],
1063
1195
  "jsdoc/check-tag-names": [
1064
1196
  "error",
1065
1197
  {
@@ -1253,7 +1385,7 @@ var jsdoc = (options = {}) => [
1253
1385
  "jsdoc/require-returns-description": "warn",
1254
1386
  "jsdoc/require-yields-check": "warn",
1255
1387
  // TypeScript rules overrides
1256
- ...options.typescript ? typescriptRules : {},
1388
+ ...options.typescript ? typescriptRules : javscriptRules,
1257
1389
  // Overrides rules
1258
1390
  ...options.overrides
1259
1391
  }
@@ -1266,13 +1398,13 @@ var jsonc = (options = {}) => [
1266
1398
  name: "ntnyq/jsonc",
1267
1399
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1268
1400
  plugins: {
1269
- jsonc: default13
1401
+ jsonc: default11
1270
1402
  },
1271
1403
  languageOptions: {
1272
1404
  parser: parserJsonc
1273
1405
  },
1274
1406
  rules: {
1275
- ...default13.configs["recommended-with-jsonc"].rules,
1407
+ ...default11.configs["recommended-with-jsonc"].rules,
1276
1408
  "jsonc/no-octal-escape": "error",
1277
1409
  "jsonc/indent": ["error", 2],
1278
1410
  "jsonc/comma-style": ["error", "last"],
@@ -1313,7 +1445,7 @@ var pinia = (options = {}) => {
1313
1445
  name: "ntnyq/pinia",
1314
1446
  files,
1315
1447
  plugins: {
1316
- pinia: default8
1448
+ pinia: default7
1317
1449
  },
1318
1450
  rules: {
1319
1451
  "pinia/prefer-single-store-per-file": "error",
@@ -1337,17 +1469,17 @@ var pinia = (options = {}) => {
1337
1469
  };
1338
1470
 
1339
1471
  // src/configs/ntnyq.ts
1472
+ import { createConfig as createNtnyqConfig } from "eslint-plugin-ntnyq";
1340
1473
  var ntnyq = (options = {}) => [
1341
1474
  {
1342
- name: "ntnyq/ntnyq",
1343
- plugins: {
1344
- ntnyq: default9
1345
- },
1346
- rules: {
1347
- "ntnyq/no-member-accessibility": "error",
1348
- // Overrides rules
1349
- ...options.overrides
1350
- }
1475
+ ...createNtnyqConfig({
1476
+ rules: {
1477
+ "ntnyq/prefer-newline-after-file-header": "error",
1478
+ // Overrides rules
1479
+ ...options.overrides
1480
+ }
1481
+ }),
1482
+ name: "ntnyq/ntnyq"
1351
1483
  }
1352
1484
  ];
1353
1485
 
@@ -1423,7 +1555,7 @@ var unocss = (options = {}) => [
1423
1555
  {
1424
1556
  name: "ntnyq/unocss",
1425
1557
  plugins: {
1426
- unocss: default15
1558
+ unocss: default13
1427
1559
  },
1428
1560
  rules: {
1429
1561
  "unocss/order": "error",
@@ -1483,66 +1615,6 @@ var DEFAULT_PRETTIER_OPTIONS = {
1483
1615
  vueIndentScriptAndStyle: false
1484
1616
  };
1485
1617
 
1486
- // src/utils/env.ts
1487
- import { resolve } from "node:path";
1488
- import process from "node:process";
1489
- import { isPackageExists } from "local-pkg";
1490
- var hasTypeScript = isPackageExists("typescript");
1491
- var hasVitest = isPackageExists("vitest");
1492
- var hasShadcnVue = isPackageExists("radix-vue") && isPackageExists("clsx");
1493
- var hasVue = isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli") || isPackageExists("vue", {
1494
- paths: [resolve(process.cwd(), "playground")]
1495
- });
1496
- var hasPinia = isPackageExists("pinia");
1497
- var hasUnoCSS = isPackageExists("unocss") || isPackageExists("@unocss/postcss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
1498
-
1499
- // src/utils/toArray.ts
1500
- function toArray(val) {
1501
- val = val ?? [];
1502
- return Array.isArray(val) ? val : [val];
1503
- }
1504
-
1505
- // src/utils/interopDefault.ts
1506
- async function interopDefault(mod) {
1507
- const resolved = await mod;
1508
- return resolved.default || resolved;
1509
- }
1510
-
1511
- // src/utils/loadPlugin.ts
1512
- async function loadPlugin(name) {
1513
- const mod = await import(name).catch((err) => {
1514
- console.error(err);
1515
- throw new Error(`Failed to load ESLint plugin '${name}'. Please install it!.`);
1516
- });
1517
- return interopDefault(mod);
1518
- }
1519
-
1520
- // src/utils/resolveSubOptions.ts
1521
- function resolveSubOptions(options, key) {
1522
- return typeof options[key] === "boolean" ? {} : options[key] || {};
1523
- }
1524
-
1525
- // src/utils/getOverrides.ts
1526
- function getOverrides(options, key) {
1527
- const subOptions = resolveSubOptions(options, key);
1528
- return "overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {};
1529
- }
1530
-
1531
- // src/utils/mergePrettierOptions.ts
1532
- function mergePrettierOptions(options = {}, overrides = {}) {
1533
- const result = {
1534
- ...options,
1535
- ...overrides,
1536
- plugins: [
1537
- // built-in plugins
1538
- ...options.plugins || [],
1539
- // custom plugins
1540
- ...overrides.plugins || []
1541
- ]
1542
- };
1543
- return result;
1544
- }
1545
-
1546
1618
  // src/configs/format.ts
1547
1619
  var format = (options = {}) => {
1548
1620
  const {
@@ -1559,7 +1631,7 @@ var format = (options = {}) => {
1559
1631
  {
1560
1632
  name: "ntnyq/format/setup",
1561
1633
  plugins: {
1562
- format: default14
1634
+ format: default12
1563
1635
  }
1564
1636
  }
1565
1637
  ];
@@ -1722,7 +1794,7 @@ var importX = (options = {}) => {
1722
1794
  {
1723
1795
  name: "ntnyq/import-x",
1724
1796
  plugins: {
1725
- "import-x": default18
1797
+ "import-x": default16
1726
1798
  },
1727
1799
  settings: {
1728
1800
  "import-x/resolver-next": [
@@ -1768,7 +1840,7 @@ var unicorn = (options = {}) => [
1768
1840
  {
1769
1841
  name: "ntnyq/unicorn",
1770
1842
  plugins: {
1771
- unicorn: default17
1843
+ unicorn: default15
1772
1844
  },
1773
1845
  rules: {
1774
1846
  "unicorn/escape-case": "error",
@@ -1895,8 +1967,8 @@ var specials = (options = {}) => {
1895
1967
  name: "ntnyq/specials/config-file",
1896
1968
  files: [`**/*.config*.${GLOB_SRC_EXT}`],
1897
1969
  plugins: {
1898
- "import-x": default18,
1899
- perfectionist: default22
1970
+ "import-x": default16,
1971
+ perfectionist: default19
1900
1972
  },
1901
1973
  rules: {
1902
1974
  "no-console": "off",
@@ -1939,10 +2011,10 @@ var comments = (options = {}) => [
1939
2011
  {
1940
2012
  name: "ntnyq/eslint-comments",
1941
2013
  plugins: {
1942
- "@eslint-community/eslint-comments": default24
2014
+ "@eslint-community/eslint-comments": default21
1943
2015
  },
1944
2016
  rules: {
1945
- ...default24.configs.recommended.rules,
2017
+ ...default21.configs.recommended.rules,
1946
2018
  "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
1947
2019
  // Overrides rules
1948
2020
  ...options.overrides
@@ -1952,7 +2024,7 @@ var comments = (options = {}) => [
1952
2024
 
1953
2025
  // src/configs/markdown.ts
1954
2026
  var markdown = (options = {}) => {
1955
- if (!Array.isArray(default10.configs?.processor)) return [];
2027
+ if (!Array.isArray(default8.configs?.processor)) return [];
1956
2028
  const {
1957
2029
  /**
1958
2030
  * code block files
@@ -1967,7 +2039,7 @@ var markdown = (options = {}) => {
1967
2039
  /**
1968
2040
  * extracting code blocks to be linted individually
1969
2041
  */
1970
- ...default10.configs.processor.map((config) => ({
2042
+ ...default8.configs.processor.map((config) => ({
1971
2043
  ...config,
1972
2044
  name: `ntnyq/${config.name}`
1973
2045
  })),
@@ -1979,7 +2051,7 @@ var markdown = (options = {}) => {
1979
2051
  files,
1980
2052
  ignores: [GLOB_MARKDOWN_NESTED],
1981
2053
  processor: mergeProcessors([
1982
- default10.processors.markdown,
2054
+ default8.processors.markdown,
1983
2055
  // Just pass through processor
1984
2056
  processorPassThrough
1985
2057
  ])
@@ -2044,7 +2116,7 @@ var prettier = (options = {}) => {
2044
2116
  {
2045
2117
  name: "ntnyq/prettier",
2046
2118
  plugins: {
2047
- prettier: default19
2119
+ prettier: default17
2048
2120
  },
2049
2121
  rules: {
2050
2122
  "vue/array-bracket-newline": "off",
@@ -2084,7 +2156,7 @@ var prettier = (options = {}) => {
2084
2156
  "vue/space-infix-ops": "off",
2085
2157
  "vue/space-unary-ops": "off",
2086
2158
  "vue/template-curly-spacing": "off",
2087
- ...default19.configs.recommended.rules,
2159
+ ...default17.configs.recommended.rules,
2088
2160
  "prettier/prettier": options.severity || options.level || "warn",
2089
2161
  // Overrides rules
2090
2162
  ...options.overrides
@@ -2097,7 +2169,7 @@ var prettier = (options = {}) => {
2097
2169
  name: "ntnyq/prettier/disabled",
2098
2170
  files: [...disabledFiles, ...userDisabledFiles],
2099
2171
  plugins: {
2100
- prettier: default19
2172
+ prettier: default17
2101
2173
  },
2102
2174
  rules: {
2103
2175
  "prettier/prettier": "off"
@@ -2107,20 +2179,24 @@ var prettier = (options = {}) => {
2107
2179
  };
2108
2180
 
2109
2181
  // src/configs/stylistic.ts
2110
- var stylistic = (options = {}) => [
2111
- {
2112
- name: "ntnyq/stylistic",
2113
- plugins: {
2114
- "@stylistic": default20
2115
- },
2116
- rules: {
2117
- // Only rules are not conflicted with Prettier
2118
- // Use stylistic config to provide type support
2119
- // Overrides rules
2120
- ...options.overrides
2182
+ var stylistic = async (options = {}) => {
2183
+ await ensurePackages(["@stylistic/eslint-plugin"]);
2184
+ const pluginStylistic = await interopDefault(import("@stylistic/eslint-plugin"));
2185
+ return [
2186
+ {
2187
+ name: "ntnyq/stylistic",
2188
+ plugins: {
2189
+ "@stylistic": pluginStylistic
2190
+ },
2191
+ rules: {
2192
+ // Only rules are not conflicted with Prettier
2193
+ // Use stylistic config to provide type support
2194
+ // Overrides rules
2195
+ ...options.overrides
2196
+ }
2121
2197
  }
2122
- }
2123
- ];
2198
+ ];
2199
+ };
2124
2200
 
2125
2201
  // src/configs/gitignore.ts
2126
2202
  import createGitIgnoreConfig from "eslint-config-flat-gitignore";
@@ -2366,7 +2442,7 @@ var jsx = () => [
2366
2442
  ];
2367
2443
 
2368
2444
  // src/configs/typescript.ts
2369
- import process2 from "node:process";
2445
+ import process4 from "node:process";
2370
2446
  var typeAwareRules = {
2371
2447
  "dot-notation": "off",
2372
2448
  "require-await": "off",
@@ -2425,7 +2501,7 @@ var typescript = (options = {}) => {
2425
2501
  allowDefaultProject: ["./*.js"],
2426
2502
  defaultProject: options.tsconfigPath
2427
2503
  },
2428
- tsconfigRootDir: process2.cwd()
2504
+ tsconfigRootDir: process4.cwd()
2429
2505
  } : {},
2430
2506
  ...parserOptions
2431
2507
  };
@@ -2445,7 +2521,7 @@ var typescript = (options = {}) => {
2445
2521
  name: "ntnyq/ts/setup",
2446
2522
  plugins: {
2447
2523
  "@typescript-eslint": plugin,
2448
- antfu: default11
2524
+ antfu: default9
2449
2525
  }
2450
2526
  },
2451
2527
  ...enableTypeAwareLint ? [
@@ -2581,6 +2657,25 @@ var typescript = (options = {}) => {
2581
2657
  ];
2582
2658
  };
2583
2659
 
2660
+ // src/configs/eslintPlugin.ts
2661
+ var eslintPlugin = async (options = {}) => {
2662
+ await ensurePackages(["eslint-plugin-eslint-plugin"]);
2663
+ const pluginESLintPlugin = await interopDefault(import("eslint-plugin-eslint-plugin"));
2664
+ return [
2665
+ {
2666
+ ...pluginESLintPlugin.configs["flat/all"],
2667
+ name: "ntnyq/eslint-plugin",
2668
+ rules: {
2669
+ ...pluginESLintPlugin.configs["flat/all"].rules,
2670
+ // injected by `createRule`
2671
+ "eslint-plugin/require-meta-docs-url": "off",
2672
+ // Overrides rules
2673
+ ...options.overrides
2674
+ }
2675
+ }
2676
+ ];
2677
+ };
2678
+
2584
2679
  // src/configs/githubAction.ts
2585
2680
  import { createRecommendedConfig } from "eslint-plugin-github-action";
2586
2681
  var githubAction = (options = {}) => {
@@ -2685,7 +2780,7 @@ var perfectionist = (options = {}) => {
2685
2780
  {
2686
2781
  name: "ntnyq/perfectionist/common",
2687
2782
  plugins: {
2688
- perfectionist: default22
2783
+ perfectionist: default19
2689
2784
  },
2690
2785
  rules: {
2691
2786
  "perfectionist/sort-imports": [
@@ -2775,7 +2870,7 @@ var perfectionist = (options = {}) => {
2775
2870
  name: "ntnyq/perfectionist/enums",
2776
2871
  files: [`**/enums/${GLOB_SRC}`, `**/enums.${GLOB_SRC_EXT}`],
2777
2872
  plugins: {
2778
- perfectionist: default22
2873
+ perfectionist: default19
2779
2874
  },
2780
2875
  rules: {
2781
2876
  "perfectionist/sort-enums": [
@@ -2804,7 +2899,7 @@ var perfectionist = (options = {}) => {
2804
2899
  name: "ntnyq/perfectionist/types",
2805
2900
  files: [...GLOB_TYPES],
2806
2901
  plugins: {
2807
- perfectionist: default22
2902
+ perfectionist: default19
2808
2903
  },
2809
2904
  rules: {
2810
2905
  "perfectionist/sort-heritage-clauses": [
@@ -2868,7 +2963,7 @@ var perfectionist = (options = {}) => {
2868
2963
  name: "ntnyq/perfectionist/constants",
2869
2964
  files: [`**/constants/${GLOB_SRC}`, `**/constants.${GLOB_SRC_EXT}`],
2870
2965
  plugins: {
2871
- perfectionist: default22
2966
+ perfectionist: default19
2872
2967
  },
2873
2968
  rules: {
2874
2969
  "perfectionist/sort-maps": [
@@ -2917,7 +3012,7 @@ var unusedImports = (options = {}) => [
2917
3012
  {
2918
3013
  name: "ntnyq/unused-imports",
2919
3014
  plugins: {
2920
- "unused-imports": default23
3015
+ "unused-imports": default20
2921
3016
  },
2922
3017
  rules: {
2923
3018
  "@typescript-eslint/no-unused-vars": "off",
@@ -2964,58 +3059,55 @@ function defineESLintConfig(options = {}, ...userConfigs) {
2964
3059
  toml: enableTOML = true,
2965
3060
  jsonc: enableJSONC = true,
2966
3061
  antfu: enableAntfu = true,
3062
+ ntnyq: enableNtnyq = true,
2967
3063
  depend: enableDepend = true,
2968
3064
  regexp: enableRegexp = true,
2969
3065
  unicorn: enableUnicorn = true,
2970
3066
  prettier: enablePrettier = true,
2971
3067
  markdown: enableMarkdown = true,
2972
- stylistic: enableStylistic = true,
2973
3068
  gitignore: enableGitIgnore = true,
2974
3069
  githubAction: enableGitHubAction = true,
2975
3070
  perfectionist: enablePerfectionist = true,
2976
3071
  // disabled by default
2977
- svgo: enableSVGO = false
3072
+ svgo: enableSVGO = false,
3073
+ stylistic: enableStylistic = false,
3074
+ eslintPlugin: enableESLintPlugin = false
2978
3075
  } = options;
2979
3076
  const configs2 = [];
2980
3077
  if (enableVue) {
2981
3078
  supportedExtensions.push("vue");
2982
3079
  }
2983
3080
  if (enableGitIgnore) {
2984
- configs2.push(
2985
- ...gitignore({
2986
- ...resolveSubOptions(options, "gitignore")
2987
- })
2988
- );
3081
+ configs2.push(gitignore(resolveSubOptions(options, "gitignore")));
2989
3082
  }
2990
3083
  configs2.push(
2991
- ...ignores(options.ignores),
2992
- ...jsx(),
2993
- ...node({
3084
+ ignores(options.ignores),
3085
+ jsx(),
3086
+ node({
2994
3087
  overrides: getOverrides(options, "node")
2995
3088
  }),
2996
- ...command({
2997
- ...resolveSubOptions(options, "command")
2998
- }),
2999
- ...importX({
3089
+ command(resolveSubOptions(options, "command")),
3090
+ importX({
3000
3091
  ...resolveSubOptions(options, "importX"),
3001
3092
  typescript: !!enableTypeScript,
3002
3093
  overrides: getOverrides(options, "importX")
3003
3094
  }),
3004
- ...jsdoc({
3095
+ jsdoc({
3005
3096
  typescript: !!enableTypeScript,
3006
- overrides: getOverrides(options, "jsdoc")
3097
+ overrides: getOverrides(options, "jsdoc"),
3098
+ ...resolveSubOptions(options, "jsdoc")
3007
3099
  }),
3008
- ...comments({
3100
+ comments({
3009
3101
  overrides: getOverrides(options, "comments")
3010
3102
  }),
3011
- ...javascript({
3103
+ javascript({
3012
3104
  ...resolveSubOptions(options, "javascript"),
3013
3105
  overrides: getOverrides(options, "javascript")
3014
3106
  })
3015
3107
  );
3016
3108
  if (enablePerfectionist) {
3017
3109
  configs2.push(
3018
- ...perfectionist({
3110
+ perfectionist({
3019
3111
  ...resolveSubOptions(options, "perfectionist"),
3020
3112
  overrides: getOverrides(options, "perfectionist")
3021
3113
  })
@@ -3023,14 +3115,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3023
3115
  }
3024
3116
  if (enableUnicorn) {
3025
3117
  configs2.push(
3026
- ...unicorn({
3118
+ unicorn({
3027
3119
  overrides: getOverrides(options, "unicorn")
3028
3120
  })
3029
3121
  );
3030
3122
  }
3031
3123
  if (enablePinia) {
3032
3124
  configs2.push(
3033
- ...pinia({
3125
+ pinia({
3034
3126
  ...resolveSubOptions(options, "pinia"),
3035
3127
  overrides: getOverrides(options, "pinia")
3036
3128
  })
@@ -3038,7 +3130,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3038
3130
  }
3039
3131
  if (enableRegexp) {
3040
3132
  configs2.push(
3041
- ...regexp({
3133
+ regexp({
3042
3134
  ...resolveSubOptions(options, "regexp"),
3043
3135
  overrides: getOverrides(options, "regexp")
3044
3136
  })
@@ -3046,7 +3138,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3046
3138
  }
3047
3139
  if (enableTypeScript) {
3048
3140
  configs2.push(
3049
- ...typescript({
3141
+ typescript({
3050
3142
  ...resolveSubOptions(options, "typescript"),
3051
3143
  extensions: supportedExtensions,
3052
3144
  overrides: getOverrides(options, "typescript")
@@ -3055,7 +3147,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3055
3147
  }
3056
3148
  if (enableVue) {
3057
3149
  configs2.push(
3058
- ...vue({
3150
+ vue({
3059
3151
  ...resolveSubOptions(options, "vue"),
3060
3152
  typescript: !!enableTypeScript,
3061
3153
  overrides: getOverrides(options, "vue")
@@ -3064,52 +3156,48 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3064
3156
  }
3065
3157
  if (enableYML) {
3066
3158
  configs2.push(
3067
- ...yml({
3159
+ yml({
3068
3160
  overrides: getOverrides(options, "yml")
3069
3161
  })
3070
3162
  );
3071
3163
  }
3072
3164
  if (enableTOML) {
3073
3165
  configs2.push(
3074
- ...toml({
3166
+ toml({
3075
3167
  overrides: getOverrides(options, "toml")
3076
3168
  })
3077
3169
  );
3078
3170
  }
3079
3171
  if (enableJSONC) {
3080
3172
  configs2.push(
3081
- ...jsonc({
3173
+ jsonc({
3082
3174
  overrides: getOverrides(options, "jsonc")
3083
3175
  })
3084
3176
  );
3085
3177
  }
3086
3178
  if (enableSort) {
3087
- configs2.push(
3088
- ...sort({
3089
- ...resolveSubOptions(options, "sort")
3090
- })
3091
- );
3179
+ configs2.push(sort(resolveSubOptions(options, "sort")));
3092
3180
  }
3093
3181
  if (enableTest) {
3094
3182
  configs2.push(
3095
- ...test({
3183
+ test({
3096
3184
  overrides: getOverrides(options, "test")
3097
3185
  }),
3098
- ...vitest({
3186
+ vitest({
3099
3187
  overrides: getOverrides(options, "test")
3100
3188
  })
3101
3189
  );
3102
3190
  }
3103
3191
  if (enableUnoCSS) {
3104
3192
  configs2.push(
3105
- ...unocss({
3193
+ unocss({
3106
3194
  overrides: getOverrides(options, "unocss")
3107
3195
  })
3108
3196
  );
3109
3197
  }
3110
3198
  if (enableMarkdown) {
3111
3199
  configs2.push(
3112
- ...markdown({
3200
+ markdown({
3113
3201
  extensions: supportedExtensions,
3114
3202
  overrides: getOverrides(options, "markdown")
3115
3203
  })
@@ -3117,43 +3205,51 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3117
3205
  }
3118
3206
  if (enableAntfu) {
3119
3207
  configs2.push(
3120
- ...antfu({
3208
+ antfu({
3121
3209
  overrides: getOverrides(options, "antfu")
3122
3210
  })
3123
3211
  );
3124
3212
  }
3125
- if (enableStylistic) {
3213
+ if (enableDepend) {
3126
3214
  configs2.push(
3127
- ...stylistic({
3128
- overrides: getOverrides(options, "stylistic")
3215
+ depend({
3216
+ ...resolveSubOptions(options, "depend"),
3217
+ overrides: getOverrides(options, "depend")
3129
3218
  })
3130
3219
  );
3131
3220
  }
3132
- if (enableDepend) {
3221
+ if (enableNtnyq) {
3133
3222
  configs2.push(
3134
- ...depend({
3135
- ...resolveSubOptions(options, "depend"),
3136
- overrides: getOverrides(options, "depend")
3223
+ ntnyq({
3224
+ overrides: getOverrides(options, "ntnyq")
3137
3225
  })
3138
3226
  );
3139
3227
  }
3140
3228
  if (enableGitHubAction) {
3141
3229
  configs2.push(
3142
- ...githubAction({
3230
+ githubAction({
3143
3231
  overrides: getOverrides(options, "githubAction")
3144
3232
  })
3145
3233
  );
3146
3234
  }
3147
- if (enableSVGO) {
3235
+ if (enableESLintPlugin) {
3148
3236
  configs2.push(
3149
- ...svgo({
3150
- ...resolveSubOptions(options, "svgo")
3237
+ eslintPlugin({
3238
+ overrides: getOverrides(options, "eslintPlugin")
3151
3239
  })
3152
3240
  );
3153
3241
  }
3154
- const configSpecials = specials({
3155
- ...resolveSubOptions(options, "specials")
3156
- });
3242
+ if (enableStylistic) {
3243
+ configs2.push(
3244
+ stylistic({
3245
+ overrides: getOverrides(options, "stylistic")
3246
+ })
3247
+ );
3248
+ }
3249
+ if (enableSVGO) {
3250
+ configs2.push(svgo(resolveSubOptions(options, "svgo")));
3251
+ }
3252
+ const configSpecials = specials(resolveSubOptions(options, "specials"));
3157
3253
  const configPrettier = enablePrettier ? prettier({
3158
3254
  ...resolveSubOptions(options, "prettier"),
3159
3255
  overrides: getOverrides(options, "prettier")
@@ -3205,13 +3301,16 @@ export {
3205
3301
  GLOB_VUE,
3206
3302
  GLOB_YAML,
3207
3303
  antfu,
3304
+ combineConfigs,
3208
3305
  command,
3209
3306
  comments,
3210
3307
  createNodeResolver,
3211
3308
  createTypeScriptImportResolver,
3212
3309
  defineESLintConfig,
3213
3310
  depend,
3311
+ ensurePackages,
3214
3312
  esX,
3313
+ eslintPlugin,
3215
3314
  format,
3216
3315
  getOverrides,
3217
3316
  githubAction,
@@ -3225,11 +3324,11 @@ export {
3225
3324
  ignores,
3226
3325
  importX,
3227
3326
  interopDefault,
3327
+ isInGitHooksOrRunByNanoStagedOrRunByTSX,
3228
3328
  javascript,
3229
3329
  jsdoc,
3230
3330
  jsonc,
3231
3331
  jsx,
3232
- loadPlugin,
3233
3332
  markdown,
3234
3333
  mergePrettierOptions,
3235
3334
  mergeProcessors,
@@ -3243,35 +3342,32 @@ export {
3243
3342
  parserYaml,
3244
3343
  perfectionist,
3245
3344
  pinia,
3246
- default11 as pluginAntfu,
3247
- default24 as pluginComments,
3345
+ default9 as pluginAntfu,
3346
+ default21 as pluginComments,
3248
3347
  pluginDepend,
3249
- default4 as pluginEsX,
3250
- default14 as pluginFormat,
3251
- default21 as pluginGitHubAction,
3252
- default18 as pluginImportX,
3253
- default12 as pluginJsdoc,
3254
- default13 as pluginJsonc,
3255
- default10 as pluginMarkdown,
3348
+ default12 as pluginFormat,
3349
+ default18 as pluginGitHubAction,
3350
+ default16 as pluginImportX,
3351
+ default10 as pluginJsdoc,
3352
+ default11 as pluginJsonc,
3353
+ default8 as pluginMarkdown,
3256
3354
  default2 as pluginNode,
3257
- default9 as pluginNtnyq,
3258
- default22 as pluginPerfectionist,
3259
- default8 as pluginPinia,
3260
- default19 as pluginPrettier,
3355
+ default19 as pluginPerfectionist,
3356
+ default7 as pluginPinia,
3357
+ default17 as pluginPrettier,
3261
3358
  pluginRegexp,
3262
- default20 as pluginStylistic,
3263
- default6 as pluginSvgo,
3264
- default7 as pluginToml,
3359
+ default5 as pluginSvgo,
3360
+ default6 as pluginToml,
3265
3361
  plugin as pluginTypeScript,
3266
- default17 as pluginUnicorn,
3267
- default15 as pluginUnoCSS,
3268
- default23 as pluginUnusedImports,
3269
- default16 as pluginVitest,
3362
+ default15 as pluginUnicorn,
3363
+ default13 as pluginUnoCSS,
3364
+ default20 as pluginUnusedImports,
3365
+ default14 as pluginVitest,
3270
3366
  default3 as pluginVue,
3271
- default5 as pluginYaml,
3367
+ default4 as pluginYaml,
3272
3368
  prettier,
3273
3369
  processorPassThrough,
3274
- default25 as processorVueBlocks,
3370
+ default22 as processorVueBlocks,
3275
3371
  regexp,
3276
3372
  resolveSubOptions,
3277
3373
  sort,