@ntnyq/eslint-config 2.8.2 → 3.0.0-beta.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
@@ -9,6 +9,12 @@ var hasVue = isPackageExists("vue") || isPackageExists("nuxt") || isPackageExist
9
9
  });
10
10
  var hasUnoCSS = isPackageExists("unocss") || isPackageExists("@unocss/postcss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
11
11
 
12
+ // src/utils/toArray.ts
13
+ function toArray(val) {
14
+ val = val ?? [];
15
+ return Array.isArray(val) ? val : [val];
16
+ }
17
+
12
18
  // src/utils/interopDefault.ts
13
19
  async function interopDefault(mod) {
14
20
  const resolved = await mod;
@@ -24,9 +30,15 @@ async function loadPlugin(name) {
24
30
  return interopDefault(mod);
25
31
  }
26
32
 
27
- // src/utils/defineConfig.ts
28
- function defineConfig(configs = []) {
29
- return configs;
33
+ // src/utils/resolveSubOptions.ts
34
+ function resolveSubOptions(options, key) {
35
+ return typeof options[key] === "boolean" ? {} : options[key] || {};
36
+ }
37
+
38
+ // src/utils/getOverrides.ts
39
+ function getOverrides(options, key) {
40
+ const sub = resolveSubOptions(options, key);
41
+ return "overrides" in sub && sub.overrides ? sub.overrides : {};
30
42
  }
31
43
 
32
44
  // src/globs.ts
@@ -116,12 +128,16 @@ var GLOB_EXCLUDE = [
116
128
  ];
117
129
 
118
130
  // src/configs/ignores.ts
119
- var ignores = defineConfig([
131
+ var ignores = (customIgnores = []) => [
120
132
  {
121
133
  name: "ntnyq/ignores",
122
- ignores: GLOB_EXCLUDE
134
+ ignores: [
135
+ ...GLOB_EXCLUDE,
136
+ // Overrides built-in ignores
137
+ ...customIgnores
138
+ ]
123
139
  }
124
- ]);
140
+ ];
125
141
 
126
142
  // src/plugins.ts
127
143
  import tseslint from "typescript-eslint";
@@ -147,7 +163,7 @@ import * as parserVue from "vue-eslint-parser";
147
163
  import * as parserJsonc from "jsonc-eslint-parser";
148
164
 
149
165
  // src/configs/node.ts
150
- var node = defineConfig([
166
+ var node = (options = {}) => [
151
167
  {
152
168
  name: "ntnyq/node",
153
169
  plugins: {
@@ -161,13 +177,15 @@ var node = defineConfig([
161
177
  "node/no-path-concat": "error",
162
178
  "node/prefer-global/buffer": ["error", "never"],
163
179
  "node/prefer-global/process": ["error", "never"],
164
- "node/process-exit-as-throw": "error"
180
+ "node/process-exit-as-throw": "error",
181
+ // Overrides built-in rules
182
+ ...options.overrides
165
183
  }
166
184
  }
167
- ]);
185
+ ];
168
186
 
169
187
  // src/configs/jsdoc.ts
170
- var jsdoc = defineConfig([
188
+ var jsdoc = (options = {}) => [
171
189
  {
172
190
  name: "ntnyq/jsdoc",
173
191
  plugins: {
@@ -190,13 +208,15 @@ var jsdoc = defineConfig([
190
208
  "jsdoc/require-returns-description": "warn",
191
209
  "jsdoc/require-yields-check": "warn",
192
210
  "jsdoc/check-alignment": "warn",
193
- "jsdoc/multiline-blocks": "warn"
211
+ "jsdoc/multiline-blocks": "warn",
212
+ // Overrides built-in rules
213
+ ...options.overrides
194
214
  }
195
215
  }
196
- ]);
216
+ ];
197
217
 
198
218
  // src/configs/imports.ts
199
- var imports = defineConfig([
219
+ var imports = (options = {}) => [
200
220
  {
201
221
  name: "ntnyq/imports",
202
222
  plugins: {
@@ -233,13 +253,15 @@ var imports = defineConfig([
233
253
  pathGroups: [{ pattern: "{{@,~}/,#}**", group: "internal" }],
234
254
  pathGroupsExcludedImportTypes: ["type"]
235
255
  }
236
- ]
256
+ ],
257
+ // Overrides built-in rules
258
+ ...options.overrides
237
259
  }
238
260
  }
239
- ]);
261
+ ];
240
262
 
241
263
  // src/configs/unicorn.ts
242
- var unicorn = defineConfig([
264
+ var unicorn = (options = {}) => [
243
265
  {
244
266
  name: "ntnyq/unicorn",
245
267
  plugins: {
@@ -309,30 +331,69 @@ var unicorn = defineConfig([
309
331
  "unicorn/prefer-array-find": "error",
310
332
  "unicorn/prefer-array-some": "error",
311
333
  "unicorn/prefer-array-flat-map": "error",
312
- "unicorn/prefer-array-index-of": "error"
334
+ "unicorn/prefer-array-index-of": "error",
335
+ // Overrides built-in rules
336
+ ...options.overrides
313
337
  }
314
338
  }
315
- ]);
339
+ ];
316
340
 
317
341
  // src/configs/prettier.ts
318
- import prettierConfig from "eslint-config-prettier";
319
- var prettier = defineConfig([
342
+ var prettier = (options = {}) => [
320
343
  {
321
344
  name: "ntnyq/prettier",
322
345
  plugins: {
323
346
  prettier: default12
324
347
  },
325
348
  rules: {
326
- ...prettierConfig.rules,
349
+ "vue/array-bracket-newline": "off",
350
+ "vue/array-bracket-spacing": "off",
351
+ "vue/array-element-newline": "off",
352
+ "vue/arrow-spacing": "off",
353
+ "vue/block-spacing": "off",
354
+ "vue/block-tag-newline": "off",
355
+ "vue/brace-style": "off",
356
+ "vue/comma-dangle": "off",
357
+ "vue/comma-spacing": "off",
358
+ "vue/comma-style": "off",
359
+ "vue/dot-location": "off",
360
+ "vue/func-call-spacing": "off",
361
+ "vue/html-closing-bracket-newline": "off",
362
+ "vue/html-closing-bracket-spacing": "off",
363
+ "vue/html-end-tags": "off",
364
+ "vue/html-indent": "off",
365
+ "vue/html-quotes": "off",
366
+ "vue/key-spacing": "off",
367
+ "vue/keyword-spacing": "off",
368
+ "vue/max-attributes-per-line": "off",
369
+ "vue/multiline-html-element-content-newline": "off",
370
+ "vue/multiline-ternary": "off",
371
+ "vue/mustache-interpolation-spacing": "off",
372
+ "vue/no-extra-parens": "off",
373
+ "vue/no-multi-spaces": "off",
374
+ "vue/no-spaces-around-equal-signs-in-attribute": "off",
375
+ "vue/object-curly-newline": "off",
376
+ "vue/object-curly-spacing": "off",
377
+ "vue/object-property-newline": "off",
378
+ "vue/operator-linebreak": "off",
379
+ "vue/quote-props": "off",
380
+ "vue/script-indent": "off",
381
+ "vue/singleline-html-element-content-newline": "off",
382
+ "vue/space-in-parens": "off",
383
+ "vue/space-infix-ops": "off",
384
+ "vue/space-unary-ops": "off",
385
+ "vue/template-curly-spacing": "off",
327
386
  ...default12.configs.recommended.rules,
328
- "prettier/prettier": "warn"
387
+ "prettier/prettier": "warn",
388
+ // Overrides built-in rules
389
+ ...options.overrides
329
390
  }
330
391
  },
331
392
  /**
332
393
  * Languages that prettier currently does not support
333
394
  */
334
395
  {
335
- name: "ntnyq/prettier/ignore",
396
+ name: "ntnyq/prettier/disabled",
336
397
  files: [GLOB_TOML],
337
398
  plugins: {
338
399
  prettier: default12
@@ -341,10 +402,10 @@ var prettier = defineConfig([
341
402
  "prettier/prettier": "off"
342
403
  }
343
404
  }
344
- ]);
405
+ ];
345
406
 
346
407
  // src/configs/comments.ts
347
- var comments = defineConfig([
408
+ var comments = (options = {}) => [
348
409
  {
349
410
  name: "ntnyq/eslint-comments",
350
411
  plugins: {
@@ -352,15 +413,17 @@ var comments = defineConfig([
352
413
  },
353
414
  rules: {
354
415
  ...default16.configs.recommended.rules,
355
- "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
416
+ "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
417
+ // Overrides built-in rules
418
+ ...options.overrides
356
419
  }
357
420
  }
358
- ]);
421
+ ];
359
422
 
360
423
  // src/configs/javascript.ts
361
424
  import globals from "globals";
362
425
  import jsConfig from "@eslint/js";
363
- var javascript = defineConfig([
426
+ var javascript = (option = {}) => [
364
427
  {
365
428
  name: "ntnyq/js/recommended",
366
429
  ...jsConfig.configs.recommended
@@ -571,7 +634,9 @@ var javascript = defineConfig([
571
634
  memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
572
635
  allowSeparatedGroups: false
573
636
  }
574
- ]
637
+ ],
638
+ // Overrides built-in rules
639
+ ...option.overrides
575
640
  }
576
641
  },
577
642
  {
@@ -589,8 +654,8 @@ var javascript = defineConfig([
589
654
  "max-lines-per-function": "off"
590
655
  }
591
656
  }
592
- ]);
593
- var jsx = defineConfig([
657
+ ];
658
+ var jsx = () => [
594
659
  {
595
660
  name: "ntnyq/jsx",
596
661
  files: ["**/*.jsx"],
@@ -602,10 +667,10 @@ var jsx = defineConfig([
602
667
  }
603
668
  }
604
669
  }
605
- ]);
670
+ ];
606
671
 
607
672
  // src/configs/typescript.ts
608
- var typescriptCore = tseslint.config({
673
+ var typescriptCore = (options = {}) => tseslint.config({
609
674
  name: "ntnyq/ts/core",
610
675
  extends: [...tseslint.configs.recommended],
611
676
  files: [GLOB_TS, GLOB_TSX],
@@ -668,10 +733,12 @@ var typescriptCore = tseslint.config({
668
733
  "@typescript-eslint/explicit-function-return-type": "off",
669
734
  "@typescript-eslint/explicit-module-boundary-types": "off",
670
735
  "@typescript-eslint/consistent-indexed-object-style": "off"
671
- }
736
+ },
737
+ // Overrides built-in rules
738
+ ...options.overrides
672
739
  });
673
- var typescript = defineConfig([
674
- ...typescriptCore,
740
+ var typescript = (options = {}) => [
741
+ ...typescriptCore(options),
675
742
  {
676
743
  name: "ntnyq/ts/dts",
677
744
  files: [GLOB_DTS],
@@ -695,10 +762,10 @@ var typescript = defineConfig([
695
762
  files: [GLOB_JS],
696
763
  rules: {}
697
764
  }
698
- ]);
765
+ ];
699
766
 
700
767
  // src/configs/unusedImports.ts
701
- var unusedImports = defineConfig([
768
+ var unusedImports = (options = {}) => [
702
769
  {
703
770
  name: "ntnyq/unused-imports",
704
771
  plugins: {
@@ -715,13 +782,15 @@ var unusedImports = defineConfig([
715
782
  args: "after-used",
716
783
  argsIgnorePattern: "^_"
717
784
  }
718
- ]
785
+ ],
786
+ // Overrides built-in rules
787
+ ...options.overrides
719
788
  }
720
789
  }
721
- ]);
790
+ ];
722
791
 
723
792
  // src/configs/perfectionist.ts
724
- var perfectionist = defineConfig([
793
+ var perfectionist = (options = {}) => [
725
794
  {
726
795
  name: "ntnyq/perfectionist",
727
796
  plugins: {
@@ -752,24 +821,28 @@ var perfectionist = defineConfig([
752
821
  }
753
822
  ],
754
823
  "perfectionist/sort-named-exports": ["warn", { groupKind: "values-first" }],
755
- "perfectionist/sort-named-imports": ["warn", { groupKind: "values-first" }]
824
+ "perfectionist/sort-named-imports": ["warn", { groupKind: "values-first" }],
825
+ // Overrides built-in rules
826
+ ...options.overrides
756
827
  }
757
828
  }
758
- ]);
829
+ ];
759
830
 
760
831
  // src/configs/regexp.ts
761
- var regexp = defineConfig([
832
+ var regexp = (options = {}) => [
762
833
  /**
763
834
  * https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/rules/recommended.ts
764
835
  */
765
836
  {
766
837
  name: "ntnyq/regexp",
767
- ...pluginRegexp.configs["flat/recommended"]
838
+ ...pluginRegexp.configs["flat/recommended"],
839
+ // Overrides built-in rules
840
+ ...options.overrides
768
841
  }
769
- ]);
842
+ ];
770
843
 
771
844
  // src/configs/unocss.ts
772
- var unocss = defineConfig([
845
+ var unocss = (options = {}) => [
773
846
  {
774
847
  name: "ntnyq/unocss",
775
848
  plugins: {
@@ -778,17 +851,24 @@ var unocss = defineConfig([
778
851
  rules: {
779
852
  "unocss/order": "error",
780
853
  // We don't use this
781
- "unocss/order-attributify": "off"
854
+ "unocss/order-attributify": "off",
855
+ // Overrides built-in rules
856
+ ...options.overrides
782
857
  }
783
858
  }
784
- ]);
859
+ ];
785
860
 
786
861
  // src/configs/command.ts
787
862
  import createCommandPlugin from "eslint-plugin-command/config";
788
- var command = defineConfig([createCommandPlugin()]);
863
+ var command = () => [
864
+ {
865
+ ...createCommandPlugin(),
866
+ name: "ntnyq/command"
867
+ }
868
+ ];
789
869
 
790
870
  // src/configs/vitest.ts
791
- var vitest = defineConfig([
871
+ var vitest = (options = {}) => [
792
872
  {
793
873
  name: "ntnyq/test",
794
874
  plugins: {
@@ -796,10 +876,12 @@ var vitest = defineConfig([
796
876
  },
797
877
  files: [GLOB_TEST],
798
878
  rules: {
799
- ...default9.configs.recommended.rules
879
+ ...default9.configs.recommended.rules,
880
+ // Overrides built-in rules
881
+ ...options.overrides
800
882
  }
801
883
  }
802
- ]);
884
+ ];
803
885
 
804
886
  // src/configs/vue.ts
805
887
  import process2 from "node:process";
@@ -824,13 +906,11 @@ var vue3Rules = {
824
906
  ...default3.configs["vue3-strongly-recommended"].rules,
825
907
  ...default3.configs["vue3-recommended"].rules
826
908
  };
827
- var vue = defineConfig([
909
+ var vue = (options = {}) => [
828
910
  ...tseslint.config({
829
911
  name: "ntnyq/vue/ts",
830
912
  files: [GLOB_VUE],
831
- // TODO: Remove this when `typescript-eslint` is aligned with `eslint`
832
- // @ts-expect-error - `typescript-eslint` is not aligned with eslint
833
- extends: typescriptCore
913
+ extends: typescriptCore()
834
914
  }),
835
915
  {
836
916
  name: "ntnyq/vue/core",
@@ -1064,13 +1144,15 @@ var vue = defineConfig([
1064
1144
  singleline: 1,
1065
1145
  multiline: 1
1066
1146
  }
1067
- ]
1147
+ ],
1148
+ // Overrides built-in rules
1149
+ ...options.overrides
1068
1150
  }
1069
1151
  }
1070
- ]);
1152
+ ];
1071
1153
 
1072
1154
  // src/configs/yml.ts
1073
- var yml = defineConfig([
1155
+ var yml = (options = {}) => [
1074
1156
  {
1075
1157
  name: "ntnyq/yaml",
1076
1158
  files: [GLOB_YAML],
@@ -1084,13 +1166,15 @@ var yml = defineConfig([
1084
1166
  ...default4.configs.standard.rules,
1085
1167
  ...default4.configs.prettier.rules,
1086
1168
  "yml/no-empty-mapping-value": "off",
1087
- "yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
1169
+ "yml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
1170
+ // Overrides built-in rules
1171
+ ...options.overrides
1088
1172
  }
1089
1173
  }
1090
- ]);
1174
+ ];
1091
1175
 
1092
1176
  // src/configs/toml.ts
1093
- var toml = defineConfig([
1177
+ var toml = (options = {}) => [
1094
1178
  {
1095
1179
  name: "ntnyq/toml",
1096
1180
  files: [GLOB_TOML],
@@ -1119,13 +1203,15 @@ var toml = defineConfig([
1119
1203
  "toml/padding-line-between-tables": "error",
1120
1204
  "toml/quoted-keys": "error",
1121
1205
  "toml/spaced-comment": "error",
1122
- "toml/table-bracket-spacing": "error"
1206
+ "toml/table-bracket-spacing": "error",
1207
+ // Overrides built-in rules
1208
+ ...options.overrides
1123
1209
  }
1124
1210
  }
1125
- ]);
1211
+ ];
1126
1212
 
1127
1213
  // src/configs/sort.ts
1128
- var sortPackageJson = defineConfig([
1214
+ var sortPackageJson = () => [
1129
1215
  {
1130
1216
  name: "ntnyq/sort/package-json",
1131
1217
  files: ["**/package.json"],
@@ -1223,8 +1309,8 @@ var sortPackageJson = defineConfig([
1223
1309
  ]
1224
1310
  }
1225
1311
  }
1226
- ]);
1227
- var sortTsConfig = defineConfig([
1312
+ ];
1313
+ var sortTsConfig = () => [
1228
1314
  {
1229
1315
  name: "ntnyq/sort/tsconfig",
1230
1316
  files: ["**/tsconfig.json", "**/tsconfig.*.json"],
@@ -1339,10 +1425,10 @@ var sortTsConfig = defineConfig([
1339
1425
  ]
1340
1426
  }
1341
1427
  }
1342
- ]);
1428
+ ];
1343
1429
 
1344
1430
  // src/configs/jsonc.ts
1345
- var jsonc = defineConfig([
1431
+ var jsonc = (options = {}) => [
1346
1432
  {
1347
1433
  name: "ntnyq/jsonc",
1348
1434
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
@@ -1379,13 +1465,15 @@ var jsonc = defineConfig([
1379
1465
  {
1380
1466
  allowMultiplePropertiesPerLine: true
1381
1467
  }
1382
- ]
1468
+ ],
1469
+ // Overrides built-in rules
1470
+ ...options.overrides
1383
1471
  }
1384
1472
  }
1385
- ]);
1473
+ ];
1386
1474
 
1387
1475
  // src/configs/markdown.ts
1388
- var markdown = defineConfig([
1476
+ var markdown = (options = {}) => [
1389
1477
  ...default13.configs.recommended,
1390
1478
  {
1391
1479
  name: "ntnyq/markdown/extensions",
@@ -1407,63 +1495,131 @@ var markdown = defineConfig([
1407
1495
  "@typescript-eslint/no-namespace": "off",
1408
1496
  "@typescript-eslint/no-unused-vars": "off",
1409
1497
  "@typescript-eslint/no-extraneous-class": "off",
1410
- "@typescript-eslint/no-use-before-define": "off"
1498
+ "@typescript-eslint/no-use-before-define": "off",
1499
+ // Overrides built-in rules
1500
+ ...options.overrides
1411
1501
  }
1412
1502
  }
1413
- ]);
1503
+ ];
1414
1504
 
1415
1505
  // src/core.ts
1416
- function ntnyq(config = [], {
1417
- vue: enableVue = hasVue,
1418
- unocss: enableUnoCSS = hasUnoCSS,
1419
- vitest: enableVitest = hasVitest,
1420
- prettier: enablePrettier = true,
1421
- markdown: enableMarkdown = true,
1422
- command: enableCommand = true
1423
- } = {}) {
1424
- const configs = defineConfig([
1506
+ function ntnyq(options = {}, customConfig = []) {
1507
+ const configs = [
1425
1508
  /**
1426
1509
  * Basic
1427
1510
  */
1428
- ...ignores,
1429
- ...jsdoc,
1430
- ...jsx,
1431
- ...node,
1432
- ...imports,
1433
- ...unicorn,
1434
- ...comments,
1435
- ...javascript,
1436
- ...regexp,
1437
- ...typescript,
1438
- /**
1439
- * Language extensions
1440
- */
1441
- ...yml,
1442
- ...toml,
1443
- ...jsonc,
1444
- ...sortPackageJson,
1445
- ...sortTsConfig
1446
- ]);
1447
- if (enableVue) {
1448
- configs.push(...vue);
1511
+ ...ignores(options.ignores),
1512
+ ...jsx(),
1513
+ ...node({
1514
+ overrides: getOverrides(options, "node")
1515
+ }),
1516
+ ...imports({
1517
+ overrides: getOverrides(options, "imports")
1518
+ }),
1519
+ ...javascript({
1520
+ overrides: getOverrides(options, "javascript")
1521
+ })
1522
+ ];
1523
+ if (options.unicorn ?? true) {
1524
+ configs.push(
1525
+ ...unicorn({
1526
+ overrides: getOverrides(options, "unicorn")
1527
+ })
1528
+ );
1529
+ }
1530
+ if (options.regexp ?? true) {
1531
+ configs.push(
1532
+ ...regexp({
1533
+ overrides: getOverrides(options, "regexp")
1534
+ })
1535
+ );
1536
+ }
1537
+ if (options.jsdoc ?? true) {
1538
+ configs.push(
1539
+ ...jsdoc({
1540
+ overrides: getOverrides(options, "jsdoc")
1541
+ })
1542
+ );
1543
+ }
1544
+ if (options.comments ?? true) {
1545
+ configs.push(
1546
+ ...comments({
1547
+ overrides: getOverrides(options, "comments")
1548
+ })
1549
+ );
1550
+ }
1551
+ if (options.typescript ?? hasTypeScript) {
1552
+ configs.push(
1553
+ ...typescript({
1554
+ overrides: getOverrides(options, "typescript")
1555
+ })
1556
+ );
1557
+ }
1558
+ if (options.sortTsConfig ?? true) {
1559
+ configs.push(...sortTsConfig());
1560
+ }
1561
+ if (options.sortPackageJson ?? true) {
1562
+ configs.push(...sortPackageJson());
1563
+ }
1564
+ if (options.yml ?? true) {
1565
+ configs.push(
1566
+ ...yml({
1567
+ overrides: getOverrides(options, "yml")
1568
+ })
1569
+ );
1570
+ }
1571
+ if (options.toml ?? true) {
1572
+ configs.push(
1573
+ ...toml({
1574
+ overrides: getOverrides(options, "toml")
1575
+ })
1576
+ );
1577
+ }
1578
+ if (options.jsonc ?? true) {
1579
+ configs.push(
1580
+ ...jsonc({
1581
+ overrides: getOverrides(options, "jsonc")
1582
+ })
1583
+ );
1449
1584
  }
1450
- if (enableVitest) {
1451
- configs.push(...vitest);
1585
+ if (options.vue ?? hasVue) {
1586
+ configs.push(
1587
+ ...vue({
1588
+ overrides: getOverrides(options, "vue")
1589
+ })
1590
+ );
1452
1591
  }
1453
- if (enableUnoCSS) {
1454
- configs.push(...unocss);
1592
+ if (options.vitest ?? hasVitest) {
1593
+ configs.push(
1594
+ ...vitest({
1595
+ overrides: getOverrides(options, "vitest")
1596
+ })
1597
+ );
1455
1598
  }
1456
- if (enableMarkdown) {
1457
- configs.push(...markdown);
1599
+ if (options.vitest ?? hasVitest) {
1600
+ configs.push(
1601
+ ...unocss({
1602
+ overrides: getOverrides(options, "unocss")
1603
+ })
1604
+ );
1458
1605
  }
1459
- if (enableCommand) {
1460
- configs.push(...command);
1606
+ if (options.markdown ?? true) {
1607
+ configs.push(
1608
+ ...markdown({
1609
+ overrides: getOverrides(options, "markdown")
1610
+ })
1611
+ );
1461
1612
  }
1462
- if (enablePrettier) {
1463
- configs.push(...prettier);
1613
+ if (options.command ?? true) {
1614
+ configs.push(...command());
1464
1615
  }
1465
- if (Object.keys(config).length > 0) {
1466
- configs.push(...Array.isArray(config) ? config : [config]);
1616
+ configs.push(...toArray(customConfig));
1617
+ if (options.prettier ?? true) {
1618
+ configs.push(
1619
+ ...prettier({
1620
+ overrides: getOverrides(options, "prettier")
1621
+ })
1622
+ );
1467
1623
  }
1468
1624
  return configs;
1469
1625
  }
@@ -1495,7 +1651,7 @@ export {
1495
1651
  GLOB_YAML,
1496
1652
  command,
1497
1653
  comments,
1498
- defineConfig,
1654
+ getOverrides,
1499
1655
  getVueVersion,
1500
1656
  hasTypeScript,
1501
1657
  hasUnoCSS,
@@ -1535,8 +1691,10 @@ export {
1535
1691
  default4 as pluginYaml,
1536
1692
  prettier,
1537
1693
  regexp,
1694
+ resolveSubOptions,
1538
1695
  sortPackageJson,
1539
1696
  sortTsConfig,
1697
+ toArray,
1540
1698
  toml,
1541
1699
  tseslint,
1542
1700
  typescript,