@ntnyq/eslint-config 2.8.2 → 3.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.cjs CHANGED
@@ -57,7 +57,7 @@ __export(src_exports, {
57
57
  GLOB_YAML: () => GLOB_YAML,
58
58
  command: () => command,
59
59
  comments: () => comments,
60
- defineConfig: () => defineConfig,
60
+ getOverrides: () => getOverrides,
61
61
  getVueVersion: () => getVueVersion,
62
62
  hasTypeScript: () => hasTypeScript,
63
63
  hasUnoCSS: () => hasUnoCSS,
@@ -97,8 +97,10 @@ __export(src_exports, {
97
97
  pluginYaml: () => import_eslint_plugin_yml.default,
98
98
  prettier: () => prettier,
99
99
  regexp: () => regexp,
100
+ resolveSubOptions: () => resolveSubOptions,
100
101
  sortPackageJson: () => sortPackageJson,
101
102
  sortTsConfig: () => sortTsConfig,
103
+ toArray: () => toArray,
102
104
  toml: () => toml,
103
105
  tseslint: () => import_typescript_eslint.default,
104
106
  typescript: () => typescript,
@@ -123,6 +125,12 @@ var hasVue = (0, import_local_pkg.isPackageExists)("vue") || (0, import_local_pk
123
125
  });
124
126
  var hasUnoCSS = (0, import_local_pkg.isPackageExists)("unocss") || (0, import_local_pkg.isPackageExists)("@unocss/postcss") || (0, import_local_pkg.isPackageExists)("@unocss/webpack") || (0, import_local_pkg.isPackageExists)("@unocss/nuxt");
125
127
 
128
+ // src/utils/toArray.ts
129
+ function toArray(val) {
130
+ val = val ?? [];
131
+ return Array.isArray(val) ? val : [val];
132
+ }
133
+
126
134
  // src/utils/interopDefault.ts
127
135
  async function interopDefault(mod) {
128
136
  const resolved = await mod;
@@ -138,9 +146,15 @@ async function loadPlugin(name) {
138
146
  return interopDefault(mod);
139
147
  }
140
148
 
141
- // src/utils/defineConfig.ts
142
- function defineConfig(configs = []) {
143
- return configs;
149
+ // src/utils/resolveSubOptions.ts
150
+ function resolveSubOptions(options, key) {
151
+ return typeof options[key] === "boolean" ? {} : options[key] || {};
152
+ }
153
+
154
+ // src/utils/getOverrides.ts
155
+ function getOverrides(options, key) {
156
+ const sub = resolveSubOptions(options, key);
157
+ return "overrides" in sub && sub.overrides ? sub.overrides : {};
144
158
  }
145
159
 
146
160
  // src/globs.ts
@@ -230,12 +244,16 @@ var GLOB_EXCLUDE = [
230
244
  ];
231
245
 
232
246
  // src/configs/ignores.ts
233
- var ignores = defineConfig([
247
+ var ignores = (customIgnores = []) => [
234
248
  {
235
249
  name: "ntnyq/ignores",
236
- ignores: GLOB_EXCLUDE
250
+ ignores: [
251
+ ...GLOB_EXCLUDE,
252
+ // Overrides built-in ignores
253
+ ...customIgnores
254
+ ]
237
255
  }
238
- ]);
256
+ ];
239
257
 
240
258
  // src/plugins.ts
241
259
  var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
@@ -261,7 +279,7 @@ var parserVue = __toESM(require("vue-eslint-parser"), 1);
261
279
  var parserJsonc = __toESM(require("jsonc-eslint-parser"), 1);
262
280
 
263
281
  // src/configs/node.ts
264
- var node = defineConfig([
282
+ var node = (options = {}) => [
265
283
  {
266
284
  name: "ntnyq/node",
267
285
  plugins: {
@@ -275,13 +293,15 @@ var node = defineConfig([
275
293
  "node/no-path-concat": "error",
276
294
  "node/prefer-global/buffer": ["error", "never"],
277
295
  "node/prefer-global/process": ["error", "never"],
278
- "node/process-exit-as-throw": "error"
296
+ "node/process-exit-as-throw": "error",
297
+ // Overrides built-in rules
298
+ ...options.overrides
279
299
  }
280
300
  }
281
- ]);
301
+ ];
282
302
 
283
303
  // src/configs/jsdoc.ts
284
- var jsdoc = defineConfig([
304
+ var jsdoc = (options = {}) => [
285
305
  {
286
306
  name: "ntnyq/jsdoc",
287
307
  plugins: {
@@ -304,13 +324,15 @@ var jsdoc = defineConfig([
304
324
  "jsdoc/require-returns-description": "warn",
305
325
  "jsdoc/require-yields-check": "warn",
306
326
  "jsdoc/check-alignment": "warn",
307
- "jsdoc/multiline-blocks": "warn"
327
+ "jsdoc/multiline-blocks": "warn",
328
+ // Overrides built-in rules
329
+ ...options.overrides
308
330
  }
309
331
  }
310
- ]);
332
+ ];
311
333
 
312
334
  // src/configs/imports.ts
313
- var imports = defineConfig([
335
+ var imports = (options = {}) => [
314
336
  {
315
337
  name: "ntnyq/imports",
316
338
  plugins: {
@@ -347,13 +369,15 @@ var imports = defineConfig([
347
369
  pathGroups: [{ pattern: "{{@,~}/,#}**", group: "internal" }],
348
370
  pathGroupsExcludedImportTypes: ["type"]
349
371
  }
350
- ]
372
+ ],
373
+ // Overrides built-in rules
374
+ ...options.overrides
351
375
  }
352
376
  }
353
- ]);
377
+ ];
354
378
 
355
379
  // src/configs/unicorn.ts
356
- var unicorn = defineConfig([
380
+ var unicorn = (options = {}) => [
357
381
  {
358
382
  name: "ntnyq/unicorn",
359
383
  plugins: {
@@ -423,30 +447,69 @@ var unicorn = defineConfig([
423
447
  "unicorn/prefer-array-find": "error",
424
448
  "unicorn/prefer-array-some": "error",
425
449
  "unicorn/prefer-array-flat-map": "error",
426
- "unicorn/prefer-array-index-of": "error"
450
+ "unicorn/prefer-array-index-of": "error",
451
+ // Overrides built-in rules
452
+ ...options.overrides
427
453
  }
428
454
  }
429
- ]);
455
+ ];
430
456
 
431
457
  // src/configs/prettier.ts
432
- var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
433
- var prettier = defineConfig([
458
+ var prettier = (options = {}) => [
434
459
  {
435
460
  name: "ntnyq/prettier",
436
461
  plugins: {
437
462
  prettier: import_eslint_plugin_prettier.default
438
463
  },
439
464
  rules: {
440
- ...import_eslint_config_prettier.default.rules,
465
+ "vue/array-bracket-newline": "off",
466
+ "vue/array-bracket-spacing": "off",
467
+ "vue/array-element-newline": "off",
468
+ "vue/arrow-spacing": "off",
469
+ "vue/block-spacing": "off",
470
+ "vue/block-tag-newline": "off",
471
+ "vue/brace-style": "off",
472
+ "vue/comma-dangle": "off",
473
+ "vue/comma-spacing": "off",
474
+ "vue/comma-style": "off",
475
+ "vue/dot-location": "off",
476
+ "vue/func-call-spacing": "off",
477
+ "vue/html-closing-bracket-newline": "off",
478
+ "vue/html-closing-bracket-spacing": "off",
479
+ "vue/html-end-tags": "off",
480
+ "vue/html-indent": "off",
481
+ "vue/html-quotes": "off",
482
+ "vue/key-spacing": "off",
483
+ "vue/keyword-spacing": "off",
484
+ "vue/max-attributes-per-line": "off",
485
+ "vue/multiline-html-element-content-newline": "off",
486
+ "vue/multiline-ternary": "off",
487
+ "vue/mustache-interpolation-spacing": "off",
488
+ "vue/no-extra-parens": "off",
489
+ "vue/no-multi-spaces": "off",
490
+ "vue/no-spaces-around-equal-signs-in-attribute": "off",
491
+ "vue/object-curly-newline": "off",
492
+ "vue/object-curly-spacing": "off",
493
+ "vue/object-property-newline": "off",
494
+ "vue/operator-linebreak": "off",
495
+ "vue/quote-props": "off",
496
+ "vue/script-indent": "off",
497
+ "vue/singleline-html-element-content-newline": "off",
498
+ "vue/space-in-parens": "off",
499
+ "vue/space-infix-ops": "off",
500
+ "vue/space-unary-ops": "off",
501
+ "vue/template-curly-spacing": "off",
441
502
  ...import_eslint_plugin_prettier.default.configs.recommended.rules,
442
- "prettier/prettier": "warn"
503
+ "prettier/prettier": "warn",
504
+ // Overrides built-in rules
505
+ ...options.overrides
443
506
  }
444
507
  },
445
508
  /**
446
509
  * Languages that prettier currently does not support
447
510
  */
448
511
  {
449
- name: "ntnyq/prettier/ignore",
512
+ name: "ntnyq/prettier/disabled",
450
513
  files: [GLOB_TOML],
451
514
  plugins: {
452
515
  prettier: import_eslint_plugin_prettier.default
@@ -455,10 +518,10 @@ var prettier = defineConfig([
455
518
  "prettier/prettier": "off"
456
519
  }
457
520
  }
458
- ]);
521
+ ];
459
522
 
460
523
  // src/configs/comments.ts
461
- var comments = defineConfig([
524
+ var comments = (options = {}) => [
462
525
  {
463
526
  name: "ntnyq/eslint-comments",
464
527
  plugins: {
@@ -466,15 +529,17 @@ var comments = defineConfig([
466
529
  },
467
530
  rules: {
468
531
  ...import_eslint_plugin_eslint_comments.default.configs.recommended.rules,
469
- "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
532
+ "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
533
+ // Overrides built-in rules
534
+ ...options.overrides
470
535
  }
471
536
  }
472
- ]);
537
+ ];
473
538
 
474
539
  // src/configs/javascript.ts
475
540
  var import_globals = __toESM(require("globals"), 1);
476
541
  var import_js = __toESM(require("@eslint/js"), 1);
477
- var javascript = defineConfig([
542
+ var javascript = (option = {}) => [
478
543
  {
479
544
  name: "ntnyq/js/recommended",
480
545
  ...import_js.default.configs.recommended
@@ -685,7 +750,9 @@ var javascript = defineConfig([
685
750
  memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
686
751
  allowSeparatedGroups: false
687
752
  }
688
- ]
753
+ ],
754
+ // Overrides built-in rules
755
+ ...option.overrides
689
756
  }
690
757
  },
691
758
  {
@@ -703,8 +770,8 @@ var javascript = defineConfig([
703
770
  "max-lines-per-function": "off"
704
771
  }
705
772
  }
706
- ]);
707
- var jsx = defineConfig([
773
+ ];
774
+ var jsx = () => [
708
775
  {
709
776
  name: "ntnyq/jsx",
710
777
  files: ["**/*.jsx"],
@@ -716,10 +783,10 @@ var jsx = defineConfig([
716
783
  }
717
784
  }
718
785
  }
719
- ]);
786
+ ];
720
787
 
721
788
  // src/configs/typescript.ts
722
- var typescriptCore = import_typescript_eslint.default.config({
789
+ var typescriptCore = (options = {}) => import_typescript_eslint.default.config({
723
790
  name: "ntnyq/ts/core",
724
791
  extends: [...import_typescript_eslint.default.configs.recommended],
725
792
  files: [GLOB_TS, GLOB_TSX],
@@ -782,10 +849,12 @@ var typescriptCore = import_typescript_eslint.default.config({
782
849
  "@typescript-eslint/explicit-function-return-type": "off",
783
850
  "@typescript-eslint/explicit-module-boundary-types": "off",
784
851
  "@typescript-eslint/consistent-indexed-object-style": "off"
785
- }
852
+ },
853
+ // Overrides built-in rules
854
+ ...options.overrides
786
855
  });
787
- var typescript = defineConfig([
788
- ...typescriptCore,
856
+ var typescript = (options = {}) => [
857
+ ...typescriptCore(options),
789
858
  {
790
859
  name: "ntnyq/ts/dts",
791
860
  files: [GLOB_DTS],
@@ -809,10 +878,10 @@ var typescript = defineConfig([
809
878
  files: [GLOB_JS],
810
879
  rules: {}
811
880
  }
812
- ]);
881
+ ];
813
882
 
814
883
  // src/configs/unusedImports.ts
815
- var unusedImports = defineConfig([
884
+ var unusedImports = (options = {}) => [
816
885
  {
817
886
  name: "ntnyq/unused-imports",
818
887
  plugins: {
@@ -829,13 +898,15 @@ var unusedImports = defineConfig([
829
898
  args: "after-used",
830
899
  argsIgnorePattern: "^_"
831
900
  }
832
- ]
901
+ ],
902
+ // Overrides built-in rules
903
+ ...options.overrides
833
904
  }
834
905
  }
835
- ]);
906
+ ];
836
907
 
837
908
  // src/configs/perfectionist.ts
838
- var perfectionist = defineConfig([
909
+ var perfectionist = (options = {}) => [
839
910
  {
840
911
  name: "ntnyq/perfectionist",
841
912
  plugins: {
@@ -866,24 +937,28 @@ var perfectionist = defineConfig([
866
937
  }
867
938
  ],
868
939
  "perfectionist/sort-named-exports": ["warn", { groupKind: "values-first" }],
869
- "perfectionist/sort-named-imports": ["warn", { groupKind: "values-first" }]
940
+ "perfectionist/sort-named-imports": ["warn", { groupKind: "values-first" }],
941
+ // Overrides built-in rules
942
+ ...options.overrides
870
943
  }
871
944
  }
872
- ]);
945
+ ];
873
946
 
874
947
  // src/configs/regexp.ts
875
- var regexp = defineConfig([
948
+ var regexp = (options = {}) => [
876
949
  /**
877
950
  * https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/rules/recommended.ts
878
951
  */
879
952
  {
880
953
  name: "ntnyq/regexp",
881
- ...pluginRegexp.configs["flat/recommended"]
954
+ ...pluginRegexp.configs["flat/recommended"],
955
+ // Overrides built-in rules
956
+ ...options.overrides
882
957
  }
883
- ]);
958
+ ];
884
959
 
885
960
  // src/configs/unocss.ts
886
- var unocss = defineConfig([
961
+ var unocss = (options = {}) => [
887
962
  {
888
963
  name: "ntnyq/unocss",
889
964
  plugins: {
@@ -892,17 +967,24 @@ var unocss = defineConfig([
892
967
  rules: {
893
968
  "unocss/order": "error",
894
969
  // We don't use this
895
- "unocss/order-attributify": "off"
970
+ "unocss/order-attributify": "off",
971
+ // Overrides built-in rules
972
+ ...options.overrides
896
973
  }
897
974
  }
898
- ]);
975
+ ];
899
976
 
900
977
  // src/configs/command.ts
901
978
  var import_config = __toESM(require("eslint-plugin-command/config"), 1);
902
- var command = defineConfig([(0, import_config.default)()]);
979
+ var command = () => [
980
+ {
981
+ ...(0, import_config.default)(),
982
+ name: "ntnyq/command"
983
+ }
984
+ ];
903
985
 
904
986
  // src/configs/vitest.ts
905
- var vitest = defineConfig([
987
+ var vitest = (options = {}) => [
906
988
  {
907
989
  name: "ntnyq/test",
908
990
  plugins: {
@@ -910,10 +992,12 @@ var vitest = defineConfig([
910
992
  },
911
993
  files: [GLOB_TEST],
912
994
  rules: {
913
- ...import_eslint_plugin2.default.configs.recommended.rules
995
+ ...import_eslint_plugin2.default.configs.recommended.rules,
996
+ // Overrides built-in rules
997
+ ...options.overrides
914
998
  }
915
999
  }
916
- ]);
1000
+ ];
917
1001
 
918
1002
  // src/configs/vue.ts
919
1003
  var import_node_process2 = __toESM(require("process"), 1);
@@ -938,13 +1022,11 @@ var vue3Rules = {
938
1022
  ...import_eslint_plugin_vue.default.configs["vue3-strongly-recommended"].rules,
939
1023
  ...import_eslint_plugin_vue.default.configs["vue3-recommended"].rules
940
1024
  };
941
- var vue = defineConfig([
1025
+ var vue = (options = {}) => [
942
1026
  ...import_typescript_eslint.default.config({
943
1027
  name: "ntnyq/vue/ts",
944
1028
  files: [GLOB_VUE],
945
- // TODO: Remove this when `typescript-eslint` is aligned with `eslint`
946
- // @ts-expect-error - `typescript-eslint` is not aligned with eslint
947
- extends: typescriptCore
1029
+ extends: typescriptCore()
948
1030
  }),
949
1031
  {
950
1032
  name: "ntnyq/vue/core",
@@ -1178,13 +1260,15 @@ var vue = defineConfig([
1178
1260
  singleline: 1,
1179
1261
  multiline: 1
1180
1262
  }
1181
- ]
1263
+ ],
1264
+ // Overrides built-in rules
1265
+ ...options.overrides
1182
1266
  }
1183
1267
  }
1184
- ]);
1268
+ ];
1185
1269
 
1186
1270
  // src/configs/yml.ts
1187
- var yml = defineConfig([
1271
+ var yml = (options = {}) => [
1188
1272
  {
1189
1273
  name: "ntnyq/yaml",
1190
1274
  files: [GLOB_YAML],
@@ -1198,13 +1282,15 @@ var yml = defineConfig([
1198
1282
  ...import_eslint_plugin_yml.default.configs.standard.rules,
1199
1283
  ...import_eslint_plugin_yml.default.configs.prettier.rules,
1200
1284
  "yml/no-empty-mapping-value": "off",
1201
- "yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
1285
+ "yml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
1286
+ // Overrides built-in rules
1287
+ ...options.overrides
1202
1288
  }
1203
1289
  }
1204
- ]);
1290
+ ];
1205
1291
 
1206
1292
  // src/configs/toml.ts
1207
- var toml = defineConfig([
1293
+ var toml = (options = {}) => [
1208
1294
  {
1209
1295
  name: "ntnyq/toml",
1210
1296
  files: [GLOB_TOML],
@@ -1233,13 +1319,15 @@ var toml = defineConfig([
1233
1319
  "toml/padding-line-between-tables": "error",
1234
1320
  "toml/quoted-keys": "error",
1235
1321
  "toml/spaced-comment": "error",
1236
- "toml/table-bracket-spacing": "error"
1322
+ "toml/table-bracket-spacing": "error",
1323
+ // Overrides built-in rules
1324
+ ...options.overrides
1237
1325
  }
1238
1326
  }
1239
- ]);
1327
+ ];
1240
1328
 
1241
1329
  // src/configs/sort.ts
1242
- var sortPackageJson = defineConfig([
1330
+ var sortPackageJson = () => [
1243
1331
  {
1244
1332
  name: "ntnyq/sort/package-json",
1245
1333
  files: ["**/package.json"],
@@ -1337,8 +1425,8 @@ var sortPackageJson = defineConfig([
1337
1425
  ]
1338
1426
  }
1339
1427
  }
1340
- ]);
1341
- var sortTsConfig = defineConfig([
1428
+ ];
1429
+ var sortTsConfig = () => [
1342
1430
  {
1343
1431
  name: "ntnyq/sort/tsconfig",
1344
1432
  files: ["**/tsconfig.json", "**/tsconfig.*.json"],
@@ -1453,10 +1541,10 @@ var sortTsConfig = defineConfig([
1453
1541
  ]
1454
1542
  }
1455
1543
  }
1456
- ]);
1544
+ ];
1457
1545
 
1458
1546
  // src/configs/jsonc.ts
1459
- var jsonc = defineConfig([
1547
+ var jsonc = (options = {}) => [
1460
1548
  {
1461
1549
  name: "ntnyq/jsonc",
1462
1550
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
@@ -1493,13 +1581,15 @@ var jsonc = defineConfig([
1493
1581
  {
1494
1582
  allowMultiplePropertiesPerLine: true
1495
1583
  }
1496
- ]
1584
+ ],
1585
+ // Overrides built-in rules
1586
+ ...options.overrides
1497
1587
  }
1498
1588
  }
1499
- ]);
1589
+ ];
1500
1590
 
1501
1591
  // src/configs/markdown.ts
1502
- var markdown = defineConfig([
1592
+ var markdown = (options = {}) => [
1503
1593
  ...import_eslint_plugin_markdown.default.configs.recommended,
1504
1594
  {
1505
1595
  name: "ntnyq/markdown/extensions",
@@ -1521,63 +1611,131 @@ var markdown = defineConfig([
1521
1611
  "@typescript-eslint/no-namespace": "off",
1522
1612
  "@typescript-eslint/no-unused-vars": "off",
1523
1613
  "@typescript-eslint/no-extraneous-class": "off",
1524
- "@typescript-eslint/no-use-before-define": "off"
1614
+ "@typescript-eslint/no-use-before-define": "off",
1615
+ // Overrides built-in rules
1616
+ ...options.overrides
1525
1617
  }
1526
1618
  }
1527
- ]);
1619
+ ];
1528
1620
 
1529
1621
  // src/core.ts
1530
- function ntnyq(config = [], {
1531
- vue: enableVue = hasVue,
1532
- unocss: enableUnoCSS = hasUnoCSS,
1533
- vitest: enableVitest = hasVitest,
1534
- prettier: enablePrettier = true,
1535
- markdown: enableMarkdown = true,
1536
- command: enableCommand = true
1537
- } = {}) {
1538
- const configs = defineConfig([
1622
+ function ntnyq(options = {}, customConfig = []) {
1623
+ const configs = [
1539
1624
  /**
1540
1625
  * Basic
1541
1626
  */
1542
- ...ignores,
1543
- ...jsdoc,
1544
- ...jsx,
1545
- ...node,
1546
- ...imports,
1547
- ...unicorn,
1548
- ...comments,
1549
- ...javascript,
1550
- ...regexp,
1551
- ...typescript,
1552
- /**
1553
- * Language extensions
1554
- */
1555
- ...yml,
1556
- ...toml,
1557
- ...jsonc,
1558
- ...sortPackageJson,
1559
- ...sortTsConfig
1560
- ]);
1561
- if (enableVue) {
1562
- configs.push(...vue);
1627
+ ...ignores(options.ignores),
1628
+ ...jsx(),
1629
+ ...node({
1630
+ overrides: getOverrides(options, "node")
1631
+ }),
1632
+ ...imports({
1633
+ overrides: getOverrides(options, "imports")
1634
+ }),
1635
+ ...javascript({
1636
+ overrides: getOverrides(options, "javascript")
1637
+ })
1638
+ ];
1639
+ if (options.unicorn ?? true) {
1640
+ configs.push(
1641
+ ...unicorn({
1642
+ overrides: getOverrides(options, "unicorn")
1643
+ })
1644
+ );
1645
+ }
1646
+ if (options.regexp ?? true) {
1647
+ configs.push(
1648
+ ...regexp({
1649
+ overrides: getOverrides(options, "regexp")
1650
+ })
1651
+ );
1652
+ }
1653
+ if (options.jsdoc ?? true) {
1654
+ configs.push(
1655
+ ...jsdoc({
1656
+ overrides: getOverrides(options, "jsdoc")
1657
+ })
1658
+ );
1659
+ }
1660
+ if (options.comments ?? true) {
1661
+ configs.push(
1662
+ ...comments({
1663
+ overrides: getOverrides(options, "comments")
1664
+ })
1665
+ );
1666
+ }
1667
+ if (options.typescript ?? hasTypeScript) {
1668
+ configs.push(
1669
+ ...typescript({
1670
+ overrides: getOverrides(options, "typescript")
1671
+ })
1672
+ );
1673
+ }
1674
+ if (options.sortTsConfig ?? true) {
1675
+ configs.push(...sortTsConfig());
1676
+ }
1677
+ if (options.sortPackageJson ?? true) {
1678
+ configs.push(...sortPackageJson());
1679
+ }
1680
+ if (options.yml ?? true) {
1681
+ configs.push(
1682
+ ...yml({
1683
+ overrides: getOverrides(options, "yml")
1684
+ })
1685
+ );
1686
+ }
1687
+ if (options.toml ?? true) {
1688
+ configs.push(
1689
+ ...toml({
1690
+ overrides: getOverrides(options, "toml")
1691
+ })
1692
+ );
1693
+ }
1694
+ if (options.jsonc ?? true) {
1695
+ configs.push(
1696
+ ...jsonc({
1697
+ overrides: getOverrides(options, "jsonc")
1698
+ })
1699
+ );
1563
1700
  }
1564
- if (enableVitest) {
1565
- configs.push(...vitest);
1701
+ if (options.vue ?? hasVue) {
1702
+ configs.push(
1703
+ ...vue({
1704
+ overrides: getOverrides(options, "vue")
1705
+ })
1706
+ );
1566
1707
  }
1567
- if (enableUnoCSS) {
1568
- configs.push(...unocss);
1708
+ if (options.vitest ?? hasVitest) {
1709
+ configs.push(
1710
+ ...vitest({
1711
+ overrides: getOverrides(options, "vitest")
1712
+ })
1713
+ );
1569
1714
  }
1570
- if (enableMarkdown) {
1571
- configs.push(...markdown);
1715
+ if (options.unocss ?? hasUnoCSS) {
1716
+ configs.push(
1717
+ ...unocss({
1718
+ overrides: getOverrides(options, "unocss")
1719
+ })
1720
+ );
1572
1721
  }
1573
- if (enableCommand) {
1574
- configs.push(...command);
1722
+ if (options.markdown ?? true) {
1723
+ configs.push(
1724
+ ...markdown({
1725
+ overrides: getOverrides(options, "markdown")
1726
+ })
1727
+ );
1575
1728
  }
1576
- if (enablePrettier) {
1577
- configs.push(...prettier);
1729
+ if (options.command ?? true) {
1730
+ configs.push(...command());
1578
1731
  }
1579
- if (Object.keys(config).length > 0) {
1580
- configs.push(...Array.isArray(config) ? config : [config]);
1732
+ configs.push(...toArray(customConfig));
1733
+ if (options.prettier ?? true) {
1734
+ configs.push(
1735
+ ...prettier({
1736
+ overrides: getOverrides(options, "prettier")
1737
+ })
1738
+ );
1581
1739
  }
1582
1740
  return configs;
1583
1741
  }
@@ -1610,7 +1768,7 @@ function ntnyq(config = [], {
1610
1768
  GLOB_YAML,
1611
1769
  command,
1612
1770
  comments,
1613
- defineConfig,
1771
+ getOverrides,
1614
1772
  getVueVersion,
1615
1773
  hasTypeScript,
1616
1774
  hasUnoCSS,
@@ -1650,8 +1808,10 @@ function ntnyq(config = [], {
1650
1808
  pluginYaml,
1651
1809
  prettier,
1652
1810
  regexp,
1811
+ resolveSubOptions,
1653
1812
  sortPackageJson,
1654
1813
  sortTsConfig,
1814
+ toArray,
1655
1815
  toml,
1656
1816
  tseslint,
1657
1817
  typescript,