@ntnyq/eslint-config 4.0.0-beta.4 → 4.0.0-beta.5

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.
Files changed (4) hide show
  1. package/README.md +5 -7
  2. package/dist/index.d.ts +15060 -13943
  3. package/dist/index.js +735 -619
  4. package/package.json +20 -15
package/dist/index.js CHANGED
@@ -4,13 +4,15 @@ import { FlatConfigComposer } from "eslint-flat-config-utils";
4
4
  // src/configs/vue.ts
5
5
  import { mergeProcessors as mergeProcessors2 } from "eslint-merge-processors";
6
6
 
7
+ // src/eslint/configs.ts
8
+ import { configs } from "typescript-eslint";
9
+
7
10
  // src/eslint/parsers.ts
8
- import tseslint from "typescript-eslint";
9
11
  import * as parserVue from "vue-eslint-parser";
10
12
  import * as parserToml from "toml-eslint-parser";
11
13
  import * as parserYaml from "yaml-eslint-parser";
12
14
  import * as parserJsonc from "jsonc-eslint-parser";
13
- var parserTypeScript = tseslint.parser;
15
+ import { parser } from "typescript-eslint";
14
16
  var parserPlain = {
15
17
  meta: {
16
18
  name: "plain-eslint-parser"
@@ -33,33 +35,31 @@ var parserPlain = {
33
35
  };
34
36
 
35
37
  // src/eslint/plugins.ts
36
- import * as pluginRegexp from "eslint-plugin-regexp";
37
38
  import * as pluginDepend from "eslint-plugin-depend";
39
+ import * as pluginRegexp from "eslint-plugin-regexp";
38
40
  import { default as default2 } from "eslint-plugin-n";
39
41
  import { default as default3 } from "eslint-plugin-vue";
40
42
  import { default as default4 } from "eslint-plugin-yml";
41
43
  import { default as default5 } from "eslint-plugin-svgo";
42
44
  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";
48
- import { plugin } from "typescript-eslint";
45
+ import { default as default7 } from "@eslint/markdown";
46
+ import { default as default8 } from "eslint-plugin-antfu";
47
+ import { default as default9 } from "eslint-plugin-jsdoc";
48
+ import { default as default10 } from "eslint-plugin-jsonc";
49
+ import { default as default11 } from "eslint-plugin-pinia";
49
50
  import { default as default12 } from "eslint-plugin-format";
51
+ import { plugin } from "typescript-eslint";
50
52
  import { default as default13 } from "@unocss/eslint-plugin";
51
53
  import { default as default14 } from "@vitest/eslint-plugin";
52
54
  import { default as default15 } from "eslint-plugin-unicorn";
53
55
  import { default as default16 } from "eslint-plugin-import-x";
54
56
  import { default as default17 } from "eslint-plugin-prettier";
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";
60
-
61
- // src/eslint/configs.ts
62
- import { configs } from "typescript-eslint";
57
+ import { default as default18 } from "eslint-plugin-de-morgan";
58
+ import { default as default19 } from "eslint-plugin-no-only-tests";
59
+ import { default as default20 } from "eslint-plugin-github-action";
60
+ import { default as default21 } from "eslint-plugin-perfectionist";
61
+ import { default as default22 } from "eslint-plugin-unused-imports";
62
+ import { default as default23 } from "@eslint-community/eslint-plugin-eslint-comments";
63
63
 
64
64
  // src/eslint/resolvers.ts
65
65
  import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
@@ -68,22 +68,29 @@ var createNodeResolver = default16.createNodeResolver;
68
68
  // src/eslint/processors.ts
69
69
  import { mergeProcessors } from "eslint-merge-processors";
70
70
  import { processorPassThrough } from "eslint-merge-processors";
71
- import { default as default23 } from "eslint-processor-vue-blocks";
71
+ import { default as default24 } from "eslint-processor-vue-blocks";
72
72
 
73
73
  // src/globs.ts
74
74
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
75
75
  var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
76
76
  var GLOB_JS = "**/*.?([cm])js";
77
77
  var GLOB_JSX = `${GLOB_JS}x`;
78
+ var GLOB_JSX_ONLY = "**/*.jsx";
78
79
  var GLOB_TS = "**/*.?([cm])ts";
79
80
  var GLOB_TSX = `${GLOB_TS}x`;
81
+ var GLOB_TSX_ONLY = "**/*.tsx";
80
82
  var GLOB_DTS = "**/*.d.?([cm])ts";
81
83
  var GLOB_TYPES = [GLOB_DTS, `**/types/${GLOB_TS}`, `**/types.ts`];
84
+ var GLOB_TYPE_TEST = [
85
+ `**/*.test-d.${GLOB_SRC_EXT}`,
86
+ `**/*.spec-d.${GLOB_SRC_EXT}`
87
+ ];
82
88
  var GLOB_TEST = [
83
89
  `**/*.test.${GLOB_SRC_EXT}`,
84
90
  `**/*.spec.${GLOB_SRC_EXT}`,
85
91
  `**/*.bench.${GLOB_SRC_EXT}`,
86
- `**/*.benchmark.${GLOB_SRC_EXT}`
92
+ `**/*.benchmark.${GLOB_SRC_EXT}`,
93
+ ...GLOB_TYPE_TEST
87
94
  ];
88
95
  var GLOB_STYLE = "**/*.{c,le,sc}ss";
89
96
  var GLOB_CSS = "**/*.css";
@@ -94,6 +101,7 @@ var GLOB_JSON = "**/*.json";
94
101
  var GLOB_JSON5 = "**/*.json5";
95
102
  var GLOB_JSONC = "**/*.jsonc";
96
103
  var GLOB_PACKAGE_JSON = "**/package.json";
104
+ var GLOB_TSCONFIG_JSON = ["**/tsconfig.json", "**/tsconfig.*.json"];
97
105
  var GLOB_SVG = "**/*.svg";
98
106
  var GLOB_VUE = "**/*.vue";
99
107
  var GLOB_YAML = "**/*.y?(a)ml";
@@ -388,7 +396,7 @@ var configVue = (options = {}) => {
388
396
  if (!sfcBlocks) return processorVueSFC;
389
397
  return mergeProcessors2([
390
398
  processorVueSFC,
391
- default23({
399
+ default24({
392
400
  ...sfcBlocks,
393
401
  blocks: {
394
402
  styles: true,
@@ -414,7 +422,7 @@ var configVue = (options = {}) => {
414
422
  parserOptions: {
415
423
  ecmaVersion: "latest",
416
424
  extraFileExtensions: [".vue"],
417
- parser: parserTypeScript,
425
+ parser,
418
426
  sourceType: "module",
419
427
  ecmaFeatures: {
420
428
  jsx: true
@@ -532,26 +540,29 @@ var configVue = (options = {}) => {
532
540
  };
533
541
 
534
542
  // src/configs/yml.ts
535
- var configYml = (options = {}) => [
536
- {
537
- name: "ntnyq/yml",
538
- files: [GLOB_YAML],
539
- plugins: {
540
- yml: default4
541
- },
542
- languageOptions: {
543
- parser: parserYaml
544
- },
545
- rules: {
546
- ...default4.configs.standard.rules,
547
- ...default4.configs.prettier.rules,
548
- "yml/no-empty-mapping-value": "off",
549
- "yml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
550
- // Overrides rules
551
- ...options.overrides
543
+ var configYml = (options = {}) => {
544
+ const { files = [GLOB_YAML] } = options;
545
+ return [
546
+ {
547
+ name: "ntnyq/yml",
548
+ files,
549
+ plugins: {
550
+ yml: default4
551
+ },
552
+ languageOptions: {
553
+ parser: parserYaml
554
+ },
555
+ rules: {
556
+ ...default4.configs.standard.rules,
557
+ ...default4.configs.prettier.rules,
558
+ "yml/no-empty-mapping-value": "off",
559
+ "yml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
560
+ // Overrides rules
561
+ ...options.overrides
562
+ }
552
563
  }
553
- }
554
- ];
564
+ ];
565
+ };
555
566
 
556
567
  // src/configs/node.ts
557
568
  var configNode = (options = {}) => [
@@ -979,42 +990,21 @@ var configSort = (options = {}) => {
979
990
  return configs2;
980
991
  };
981
992
 
982
- // src/configs/toml.ts
983
- var configToml = (options = {}) => [
984
- {
985
- name: "ntnyq/toml",
986
- files: [GLOB_TOML],
987
- plugins: {
988
- toml: default6
989
- },
990
- languageOptions: {
991
- parser: parserToml
992
- },
993
- rules: {
994
- "toml/array-bracket-newline": "error",
995
- "toml/array-bracket-spacing": ["error", "never"],
996
- "toml/array-element-newline": ["error", "never"],
997
- "toml/comma-style": "error",
998
- "toml/indent": ["error", 2],
999
- "toml/inline-table-curly-spacing": "error",
1000
- "toml/key-spacing": "error",
1001
- "toml/keys-order": "error",
1002
- "toml/no-space-dots": "error",
1003
- "toml/no-unreadable-number-separator": "error",
1004
- "toml/padding-line-between-pairs": "error",
1005
- "toml/padding-line-between-tables": "error",
1006
- "toml/precision-of-fractional-seconds": "error",
1007
- "toml/precision-of-integer": "error",
1008
- "toml/quoted-keys": "error",
1009
- "toml/spaced-comment": "error",
1010
- "toml/table-bracket-spacing": "error",
1011
- "toml/tables-order": "error",
1012
- "toml/vue-custom-block/no-parsing-error": "error",
1013
- // Overrides rules
1014
- ...options.overrides
1015
- }
1016
- }
1017
- ];
993
+ // src/configs/svgo.ts
994
+ import { createConfig as createSVGOConfig } from "eslint-plugin-svgo";
995
+ var configSVGO = (options = {}) => {
996
+ const { files = [GLOB_SVG], rules: overridesRules = {} } = options;
997
+ return [
998
+ createSVGOConfig({
999
+ name: "ntnyq/svgo",
1000
+ files,
1001
+ rules: {
1002
+ "svgo/svgo": "error",
1003
+ ...overridesRules
1004
+ }
1005
+ })
1006
+ ];
1007
+ };
1018
1008
 
1019
1009
  // src/utils/env.ts
1020
1010
  import { resolve } from "node:path";
@@ -1130,7 +1120,7 @@ var configTest = (options = {}) => {
1130
1120
  {
1131
1121
  name: "ntnyq/test/setup",
1132
1122
  plugins: {
1133
- "no-only-tests": default18
1123
+ "no-only-tests": default19
1134
1124
  }
1135
1125
  },
1136
1126
  {
@@ -1162,19 +1152,43 @@ var configTest = (options = {}) => {
1162
1152
  return configs2;
1163
1153
  };
1164
1154
 
1165
- // src/configs/svgo.ts
1166
- import { createConfig as createSVGOConfig } from "eslint-plugin-svgo";
1167
- var configSVGO = (options = {}) => {
1168
- const { files = [GLOB_SVG], rules: overridesRules = {} } = options;
1155
+ // src/configs/toml.ts
1156
+ var configToml = (options = {}) => {
1157
+ const { files = [GLOB_TOML] } = options;
1169
1158
  return [
1170
- createSVGOConfig({
1171
- name: "ntnyq/svgo",
1159
+ {
1160
+ name: "ntnyq/toml",
1172
1161
  files,
1162
+ plugins: {
1163
+ toml: default6
1164
+ },
1165
+ languageOptions: {
1166
+ parser: parserToml
1167
+ },
1173
1168
  rules: {
1174
- "svgo/svgo": "error",
1175
- ...overridesRules
1169
+ "toml/array-bracket-newline": "error",
1170
+ "toml/array-bracket-spacing": ["error", "never"],
1171
+ "toml/array-element-newline": ["error", "never"],
1172
+ "toml/comma-style": "error",
1173
+ "toml/indent": ["error", 2],
1174
+ "toml/inline-table-curly-spacing": "error",
1175
+ "toml/key-spacing": "error",
1176
+ "toml/keys-order": "error",
1177
+ "toml/no-space-dots": "error",
1178
+ "toml/no-unreadable-number-separator": "error",
1179
+ "toml/padding-line-between-pairs": "error",
1180
+ "toml/padding-line-between-tables": "error",
1181
+ "toml/precision-of-fractional-seconds": "error",
1182
+ "toml/precision-of-integer": "error",
1183
+ "toml/quoted-keys": "error",
1184
+ "toml/spaced-comment": "error",
1185
+ "toml/table-bracket-spacing": "error",
1186
+ "toml/tables-order": "error",
1187
+ "toml/vue-custom-block/no-parsing-error": "error",
1188
+ // Overrides rules
1189
+ ...options.overrides
1176
1190
  }
1177
- })
1191
+ }
1178
1192
  ];
1179
1193
  };
1180
1194
 
@@ -1183,7 +1197,7 @@ var configAntfu = (options = {}) => [
1183
1197
  {
1184
1198
  name: "ntnyq/antfu",
1185
1199
  plugins: {
1186
- antfu: default9
1200
+ antfu: default8
1187
1201
  },
1188
1202
  rules: {
1189
1203
  // required `object-curly-newline` to be disabled
@@ -1217,7 +1231,7 @@ var configJsdoc = (options = {}) => [
1217
1231
  {
1218
1232
  name: "ntnyq/jsdoc",
1219
1233
  plugins: {
1220
- jsdoc: default10
1234
+ jsdoc: default9
1221
1235
  },
1222
1236
  rules: {
1223
1237
  // Disabled rules
@@ -1291,47 +1305,65 @@ var configJsdoc = (options = {}) => [
1291
1305
  ];
1292
1306
 
1293
1307
  // src/configs/jsonc.ts
1294
- var configJsonc = (options = {}) => [
1295
- {
1296
- name: "ntnyq/jsonc",
1297
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1298
- plugins: {
1299
- jsonc: default11
1300
- },
1301
- languageOptions: {
1302
- parser: parserJsonc
1303
- },
1304
- rules: {
1305
- ...default11.configs["recommended-with-jsonc"].rules,
1306
- "jsonc/array-bracket-spacing": ["error", "never"],
1307
- "jsonc/comma-dangle": ["error", "never"],
1308
- "jsonc/comma-style": ["error", "last"],
1309
- "jsonc/indent": ["error", 2],
1310
- "jsonc/key-spacing": [
1311
- "error",
1312
- {
1313
- afterColon: true,
1314
- beforeColon: false
1315
- }
1316
- ],
1317
- "jsonc/no-octal-escape": "error",
1318
- "jsonc/object-curly-newline": [
1319
- "error",
1320
- {
1321
- consistent: true,
1322
- multiline: true
1323
- }
1324
- ],
1325
- "jsonc/object-curly-spacing": ["error", "always"],
1326
- "jsonc/object-property-newline": [
1327
- "error",
1328
- {
1329
- allowMultiplePropertiesPerLine: true
1330
- }
1331
- ],
1332
- // Overrides rules
1333
- ...options.overrides
1308
+ var configJsonc = (options = {}) => {
1309
+ const { files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC] } = options;
1310
+ return [
1311
+ {
1312
+ name: "ntnyq/jsonc",
1313
+ files,
1314
+ plugins: {
1315
+ jsonc: default10
1316
+ },
1317
+ languageOptions: {
1318
+ parser: parserJsonc
1319
+ },
1320
+ rules: {
1321
+ ...default10.configs["recommended-with-jsonc"].rules,
1322
+ "jsonc/array-bracket-spacing": ["error", "never"],
1323
+ "jsonc/comma-dangle": ["error", "never"],
1324
+ "jsonc/comma-style": ["error", "last"],
1325
+ "jsonc/indent": ["error", 2],
1326
+ "jsonc/key-spacing": [
1327
+ "error",
1328
+ {
1329
+ afterColon: true,
1330
+ beforeColon: false
1331
+ }
1332
+ ],
1333
+ "jsonc/no-octal-escape": "error",
1334
+ "jsonc/object-curly-newline": [
1335
+ "error",
1336
+ {
1337
+ consistent: true,
1338
+ multiline: true
1339
+ }
1340
+ ],
1341
+ "jsonc/object-curly-spacing": ["error", "always"],
1342
+ "jsonc/object-property-newline": [
1343
+ "error",
1344
+ {
1345
+ allowMultiplePropertiesPerLine: true
1346
+ }
1347
+ ],
1348
+ // Overrides rules
1349
+ ...options.overrides
1350
+ }
1334
1351
  }
1352
+ ];
1353
+ };
1354
+
1355
+ // src/configs/ntnyq.ts
1356
+ import { createConfig as createNtnyqConfig } from "eslint-plugin-ntnyq";
1357
+ var configNtnyq = (options = {}) => [
1358
+ {
1359
+ ...createNtnyqConfig({
1360
+ rules: {
1361
+ "ntnyq/prefer-newline-after-file-header": "error",
1362
+ // Overrides rules
1363
+ ...options.overrides
1364
+ }
1365
+ }),
1366
+ name: "ntnyq/ntnyq"
1335
1367
  }
1336
1368
  ];
1337
1369
 
@@ -1343,7 +1375,7 @@ var configPinia = (options = {}) => {
1343
1375
  name: "ntnyq/pinia",
1344
1376
  files,
1345
1377
  plugins: {
1346
- pinia: default7
1378
+ pinia: default11
1347
1379
  },
1348
1380
  rules: {
1349
1381
  "pinia/never-export-initialized-store": "error",
@@ -1366,21 +1398,6 @@ var configPinia = (options = {}) => {
1366
1398
  ];
1367
1399
  };
1368
1400
 
1369
- // src/configs/ntnyq.ts
1370
- import { createConfig as createNtnyqConfig } from "eslint-plugin-ntnyq";
1371
- var configNtnyq = (options = {}) => [
1372
- {
1373
- ...createNtnyqConfig({
1374
- rules: {
1375
- "ntnyq/prefer-newline-after-file-header": "error",
1376
- // Overrides rules
1377
- ...options.overrides
1378
- }
1379
- }),
1380
- name: "ntnyq/ntnyq"
1381
- }
1382
- ];
1383
-
1384
1401
  // src/configs/depend.ts
1385
1402
  var configDepend = (options = {}) => {
1386
1403
  const {
@@ -1422,50 +1439,8 @@ var configDepend = (options = {}) => {
1422
1439
  return configs2;
1423
1440
  };
1424
1441
 
1425
- // src/configs/regexp.ts
1426
- var configRegexp = (options = {}) => {
1427
- const recommendedConfig = pluginRegexp.configs["flat/recommended"];
1428
- const recommendedRules2 = {
1429
- ...recommendedConfig.rules
1430
- };
1431
- if (options.severity === "warn") {
1432
- for (const key in recommendedRules2) {
1433
- if (recommendedRules2[key] === "error") {
1434
- recommendedRules2[key] = "warn";
1435
- }
1436
- }
1437
- }
1438
- return [
1439
- {
1440
- ...recommendedConfig,
1441
- name: "ntnyq/regexp",
1442
- rules: {
1443
- ...recommendedRules2,
1444
- // Overrides rules
1445
- ...options.overrides
1446
- }
1447
- }
1448
- ];
1449
- };
1450
-
1451
- // src/configs/unocss.ts
1452
- var configUnoCSS = (options = {}) => [
1453
- {
1454
- name: "ntnyq/unocss",
1455
- plugins: {
1456
- unocss: default13
1457
- },
1458
- rules: {
1459
- "unocss/order-attributify": options.attributify ? "error" : "off",
1460
- "unocss/order": "error",
1461
- // Overrides rules
1462
- ...options.overrides
1463
- }
1464
- }
1465
- ];
1466
-
1467
- // src/constants.ts
1468
- var DEFAULT_PRETTIER_OPTIONS = {
1442
+ // src/constants/prettier.ts
1443
+ var PRETTIER_DEFAULT_OPTIONS = {
1469
1444
  arrowParens: "avoid",
1470
1445
  bracketSameLine: false,
1471
1446
  bracketSpacing: true,
@@ -1492,68 +1467,187 @@ var DEFAULT_PRETTIER_OPTIONS = {
1492
1467
  vueIndentScriptAndStyle: false
1493
1468
  };
1494
1469
 
1495
- // src/configs/format.ts
1496
- var configFormat = (options = {}) => {
1497
- const {
1498
- css: enableCSS = true,
1499
- html: enableHTML = true,
1500
- // user custom options
1501
- prettierOptions = {}
1502
- } = options;
1503
- const sharedPrettierOptions = {
1504
- ...DEFAULT_PRETTIER_OPTIONS,
1505
- ...prettierOptions
1506
- };
1507
- const configs2 = [
1508
- {
1509
- name: "ntnyq/format/setup",
1510
- plugins: {
1511
- format: default12
1512
- }
1513
- }
1514
- ];
1515
- if (enableCSS) {
1516
- configs2.push(
1517
- {
1518
- name: "ntnyq/format/css",
1519
- files: [GLOB_CSS, GLOB_POSTCSS],
1520
- languageOptions: {
1521
- parser: parserPlain
1522
- },
1523
- rules: {
1524
- "format/prettier": [
1525
- "error",
1526
- mergePrettierOptions(sharedPrettierOptions, {
1527
- parser: "css"
1528
- })
1529
- ]
1530
- }
1531
- },
1532
- {
1533
- name: "ntnyq/format/scss",
1534
- files: [GLOB_SCSS],
1535
- languageOptions: {
1536
- parser: parserPlain
1537
- },
1538
- rules: {
1539
- "format/prettier": [
1540
- "error",
1541
- mergePrettierOptions(sharedPrettierOptions, {
1542
- parser: "scss"
1543
- })
1544
- ]
1545
- }
1546
- },
1547
- {
1548
- name: "ntnyq/format/less",
1549
- files: [GLOB_LESS],
1550
- languageOptions: {
1551
- parser: parserPlain
1552
- },
1553
- rules: {
1554
- "format/prettier": [
1555
- "error",
1556
- mergePrettierOptions(sharedPrettierOptions, {
1470
+ // src/constants/perfectionist.ts
1471
+ var PERFECTIONIST_COMMON_RULE_OPTIONS = {
1472
+ fallbackSort: { order: "asc", type: "alphabetical" },
1473
+ ignoreCase: true,
1474
+ order: "asc",
1475
+ type: "alphabetical"
1476
+ };
1477
+ var PERFECTIONIST_EXTRA_RULE_OPTIONS = {
1478
+ newlinesBetween: "ignore",
1479
+ partitionByComment: ["@pg", "@perfectionist-group"]
1480
+ };
1481
+ var PERFECTIONIST_SORT_OBJECTS_GROUPS = [
1482
+ "property",
1483
+ "multiline-property",
1484
+ "method",
1485
+ "multiline-method",
1486
+ "unknown"
1487
+ ];
1488
+ var PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS = [
1489
+ "required-property",
1490
+ "optional-property",
1491
+ "required-method",
1492
+ "optional-method",
1493
+ "required-multiline-property",
1494
+ "optional-multiline-property",
1495
+ "required-multiline-method",
1496
+ "optional-multiline-method",
1497
+ "unknown",
1498
+ "index-signature",
1499
+ "multiline-index-signature"
1500
+ ];
1501
+ var PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS = [
1502
+ /**
1503
+ * eg. 'foobar', 24, false
1504
+ */
1505
+ "literal",
1506
+ /**
1507
+ * eg. number, string
1508
+ */
1509
+ "keyword",
1510
+ /**
1511
+ * eg. FooBar
1512
+ */
1513
+ "named",
1514
+ /**
1515
+ * eg. Foo & Bar
1516
+ */
1517
+ "intersection",
1518
+ /**
1519
+ * eg. Foobar extends string ? Foo : Bar
1520
+ */
1521
+ "conditional",
1522
+ /**
1523
+ * eg. (...args: any[]) => void
1524
+ */
1525
+ "function",
1526
+ /**
1527
+ * eg. import('eslint').Linter
1528
+ */
1529
+ "import",
1530
+ /**
1531
+ * eg. { foo: string; bar: number; }
1532
+ */
1533
+ "object",
1534
+ /**
1535
+ * eg. keyof T
1536
+ */
1537
+ "operator",
1538
+ /**
1539
+ * eg. [string, number]
1540
+ */
1541
+ "tuple",
1542
+ /**
1543
+ * eg. Foo | Bar
1544
+ */
1545
+ "union",
1546
+ /**
1547
+ * eg. null | undefined
1548
+ */
1549
+ "nullish"
1550
+ ];
1551
+ var PERFECTIONIST_SORT_IMPORTS_GROUPS = [
1552
+ // Side effect style imports (e.g. 'normalize.css')
1553
+ "side-effect-style",
1554
+ // Styles (e.g. *.{css,scss,less})
1555
+ "style",
1556
+ // Node.js built-in modules. (e.g. fs, path)
1557
+ "builtin",
1558
+ // External modules installed in the project (e.g. vue, lodash)
1559
+ "external",
1560
+ // Internal modules (e.g. @/utils, @/components)
1561
+ "internal",
1562
+ // Modules from parent directory (e.g. ../utils)
1563
+ "parent",
1564
+ // Modules from the same directory (e.g. ./utils)
1565
+ "sibling",
1566
+ // Main file from the current directory (e.g. ./index)
1567
+ "index",
1568
+ // TypeScript object-imports (e.g. import log = console.log)
1569
+ "object",
1570
+ // Side effect imports (e.g. import 'babel-polyfill')
1571
+ "side-effect",
1572
+ /**
1573
+ * Type import at the end
1574
+ */
1575
+ "builtin-type",
1576
+ "external-type",
1577
+ "internal-type",
1578
+ "parent-type",
1579
+ "sibling-type",
1580
+ "index-type",
1581
+ "type",
1582
+ /**
1583
+ * Imports that don’t fit into any other group
1584
+ */
1585
+ "unknown"
1586
+ ];
1587
+ var PERFECTIONIST_SORT_CLASSES_GROUPS = ["unknown"];
1588
+
1589
+ // src/configs/format.ts
1590
+ var configFormat = (options = {}) => {
1591
+ const {
1592
+ css: enableCSS = true,
1593
+ html: enableHTML = true,
1594
+ // user custom options
1595
+ prettierOptions = {}
1596
+ } = options;
1597
+ const sharedPrettierOptions = {
1598
+ ...PRETTIER_DEFAULT_OPTIONS,
1599
+ ...prettierOptions
1600
+ };
1601
+ const configs2 = [
1602
+ {
1603
+ name: "ntnyq/format/setup",
1604
+ plugins: {
1605
+ format: default12
1606
+ }
1607
+ }
1608
+ ];
1609
+ if (enableCSS) {
1610
+ configs2.push(
1611
+ {
1612
+ name: "ntnyq/format/css",
1613
+ files: [GLOB_CSS, GLOB_POSTCSS],
1614
+ languageOptions: {
1615
+ parser: parserPlain
1616
+ },
1617
+ rules: {
1618
+ "format/prettier": [
1619
+ "error",
1620
+ mergePrettierOptions(sharedPrettierOptions, {
1621
+ parser: "css"
1622
+ })
1623
+ ]
1624
+ }
1625
+ },
1626
+ {
1627
+ name: "ntnyq/format/scss",
1628
+ files: [GLOB_SCSS],
1629
+ languageOptions: {
1630
+ parser: parserPlain
1631
+ },
1632
+ rules: {
1633
+ "format/prettier": [
1634
+ "error",
1635
+ mergePrettierOptions(sharedPrettierOptions, {
1636
+ parser: "scss"
1637
+ })
1638
+ ]
1639
+ }
1640
+ },
1641
+ {
1642
+ name: "ntnyq/format/less",
1643
+ files: [GLOB_LESS],
1644
+ languageOptions: {
1645
+ parser: parserPlain
1646
+ },
1647
+ rules: {
1648
+ "format/prettier": [
1649
+ "error",
1650
+ mergePrettierOptions(sharedPrettierOptions, {
1557
1651
  parser: "less"
1558
1652
  })
1559
1653
  ]
@@ -1581,6 +1675,48 @@ var configFormat = (options = {}) => {
1581
1675
  return configs2;
1582
1676
  };
1583
1677
 
1678
+ // src/configs/regexp.ts
1679
+ var configRegexp = (options = {}) => {
1680
+ const recommendedConfig = pluginRegexp.configs["flat/recommended"];
1681
+ const recommendedRules2 = {
1682
+ ...recommendedConfig.rules
1683
+ };
1684
+ if (options.severity === "warn") {
1685
+ for (const key in recommendedRules2) {
1686
+ if (recommendedRules2[key] === "error") {
1687
+ recommendedRules2[key] = "warn";
1688
+ }
1689
+ }
1690
+ }
1691
+ return [
1692
+ {
1693
+ ...recommendedConfig,
1694
+ name: "ntnyq/regexp",
1695
+ rules: {
1696
+ ...recommendedRules2,
1697
+ // Overrides rules
1698
+ ...options.overrides
1699
+ }
1700
+ }
1701
+ ];
1702
+ };
1703
+
1704
+ // src/configs/unocss.ts
1705
+ var configUnoCSS = (options = {}) => [
1706
+ {
1707
+ name: "ntnyq/unocss",
1708
+ plugins: {
1709
+ unocss: default13
1710
+ },
1711
+ rules: {
1712
+ "unocss/order-attributify": options.attributify ? "error" : "off",
1713
+ "unocss/order": "error",
1714
+ // Overrides rules
1715
+ ...options.overrides
1716
+ }
1717
+ }
1718
+ ];
1719
+
1584
1720
  // src/configs/command.ts
1585
1721
  import { builtinCommands } from "eslint-plugin-command/commands";
1586
1722
  import createCommandConfig from "eslint-plugin-command/config";
@@ -1816,108 +1952,18 @@ var configUnicorn = (options = {}) => [
1816
1952
  }
1817
1953
  ];
1818
1954
 
1819
- // src/configs/specials.ts
1820
- import globals from "globals";
1821
- var configSpecials = (options = {}) => {
1822
- const {
1823
- // Enable shadcn-vue support
1824
- shadcnVue: enableShadcnVue = hasShadcnVue()
1825
- } = options;
1826
- const configs2 = [
1827
- {
1828
- name: "ntnyq/specials/scripts",
1829
- files: [`**/scripts/${GLOB_SRC}`],
1830
- rules: {
1831
- "@typescript-eslint/explicit-function-return-type": "off",
1832
- "no-console": "off",
1833
- // Overrides rules
1834
- ...options.overridesScriptsRules
1835
- }
1836
- },
1837
- {
1838
- name: "ntnyq/specials/cli",
1839
- files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
1840
- rules: {
1841
- "@typescript-eslint/explicit-function-return-type": "off",
1842
- "no-console": "off",
1843
- // Overrides rules
1844
- ...options.overridesCliRules
1845
- }
1846
- },
1847
- {
1848
- name: "ntnyq/specials/userscript",
1849
- files: [`**/*.user.${GLOB_SRC_EXT}`],
1850
- languageOptions: {
1851
- globals: {
1852
- ...globals.greasemonkey
1853
- }
1854
- },
1855
- rules: {
1856
- camelcase: [
1857
- "error",
1858
- {
1859
- allow: ["^GM_.+"]
1860
- }
1861
- ],
1862
- // Overrides rules
1863
- ...options.overridesUserScriptsRules
1864
- }
1865
- },
1866
- {
1867
- name: "ntnyq/specials/config-file",
1868
- files: [`**/*.config*.${GLOB_SRC_EXT}`],
1869
- plugins: {
1870
- "import-x": default16,
1871
- perfectionist: default20
1872
- },
1873
- rules: {
1874
- "@typescript-eslint/explicit-function-return-type": "off",
1875
- "import-x/no-default-export": "off",
1876
- "no-console": "off",
1877
- "perfectionist/sort-objects": [
1878
- "error",
1879
- {
1880
- ignoreCase: true,
1881
- newlinesBetween: "ignore",
1882
- order: "asc",
1883
- partitionByComment: true,
1884
- type: "alphabetical",
1885
- groups: [
1886
- "property",
1887
- "multiline-property",
1888
- "method",
1889
- "multiline-method",
1890
- "unknown"
1891
- ]
1892
- }
1893
- ],
1894
- ...options.overridesConfigFileRules
1895
- }
1955
+ // src/configs/deMorgan.ts
1956
+ var configDeMorgan = (options = {}) => [
1957
+ {
1958
+ ...default18.configs.recommended,
1959
+ name: "ntnyq/de-morgan",
1960
+ rules: {
1961
+ ...default18.configs.recommended.rules,
1962
+ // Overrides rules
1963
+ ...options.overrides
1896
1964
  }
1897
- ];
1898
- if (enableShadcnVue) {
1899
- const shadcnOptions = resolveSubOptions(options, "shadcnVue");
1900
- configs2.push({
1901
- name: "ntnyq/specials/shadcn-vue",
1902
- files: shadcnOptions.files || [
1903
- "**/components/ui/**/*.ts",
1904
- "**/components/ui/**/*.vue"
1905
- ],
1906
- rules: {
1907
- "@typescript-eslint/consistent-type-imports": "off",
1908
- "@typescript-eslint/no-unused-vars": "off",
1909
- "import-x/consistent-type-specifier-style": "off",
1910
- "vue/define-emits-declaration": "off",
1911
- // Overrides rules
1912
- ...shadcnOptions.overridesRules
1913
- }
1914
- });
1915
- }
1916
- if (options.specialCaseConfigs) {
1917
- configs2.push(...options.specialCaseConfigs);
1918
1965
  }
1919
- return configs2;
1920
- };
1966
+ ];
1921
1967
 
1922
1968
  // src/configs/markdown.ts
1923
1969
  var configMarkdown = (options = {}) => {
@@ -1935,7 +1981,7 @@ var configMarkdown = (options = {}) => {
1935
1981
  /**
1936
1982
  * extracting code blocks to be linted individually
1937
1983
  */
1938
- ...default8.configs.processor.map((config) => ({
1984
+ ...default7.configs.processor.map((config) => ({
1939
1985
  ...config,
1940
1986
  name: `ntnyq/${config.name}`
1941
1987
  })),
@@ -1947,7 +1993,7 @@ var configMarkdown = (options = {}) => {
1947
1993
  files,
1948
1994
  ignores: [GLOB_MARKDOWN_NESTED],
1949
1995
  processor: mergeProcessors([
1950
- default8.processors.markdown,
1996
+ default7.processors.markdown,
1951
1997
  // Just pass through processor
1952
1998
  processorPassThrough
1953
1999
  ])
@@ -2061,23 +2107,117 @@ var configPrettier = (options = {}) => {
2061
2107
  ...default17.configs.recommended.rules,
2062
2108
  "prettier/prettier": options.severity || "warn",
2063
2109
  // Overrides rules
2064
- ...options.overrides
2110
+ ...options.overrides
2111
+ }
2112
+ },
2113
+ /**
2114
+ * Languages that prettier currently does not support
2115
+ */
2116
+ {
2117
+ name: "ntnyq/prettier/disabled",
2118
+ files: [...disabledFiles, ...userDisabledFiles],
2119
+ plugins: {
2120
+ prettier: default17
2121
+ },
2122
+ rules: {
2123
+ "prettier/prettier": "off"
2124
+ }
2125
+ }
2126
+ ];
2127
+ };
2128
+
2129
+ // src/configs/specials.ts
2130
+ import globals from "globals";
2131
+ var configSpecials = (options = {}) => {
2132
+ const {
2133
+ // Enable shadcn-vue support
2134
+ shadcnVue: enableShadcnVue = hasShadcnVue()
2135
+ } = options;
2136
+ const configs2 = [
2137
+ {
2138
+ name: "ntnyq/specials/scripts",
2139
+ files: [`**/scripts/${GLOB_SRC}`],
2140
+ rules: {
2141
+ "@typescript-eslint/explicit-function-return-type": "off",
2142
+ "no-console": "off",
2143
+ // Overrides rules
2144
+ ...options.overridesScriptsRules
2145
+ }
2146
+ },
2147
+ {
2148
+ name: "ntnyq/specials/cli",
2149
+ files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
2150
+ rules: {
2151
+ "@typescript-eslint/explicit-function-return-type": "off",
2152
+ "no-console": "off",
2153
+ // Overrides rules
2154
+ ...options.overridesCliRules
2155
+ }
2156
+ },
2157
+ {
2158
+ name: "ntnyq/specials/userscript",
2159
+ files: [`**/*.user.${GLOB_SRC_EXT}`],
2160
+ languageOptions: {
2161
+ globals: {
2162
+ ...globals.greasemonkey
2163
+ }
2164
+ },
2165
+ rules: {
2166
+ camelcase: [
2167
+ "error",
2168
+ {
2169
+ allow: ["^GM_.+"]
2170
+ }
2171
+ ],
2172
+ // Overrides rules
2173
+ ...options.overridesUserScriptsRules
2065
2174
  }
2066
2175
  },
2067
- /**
2068
- * Languages that prettier currently does not support
2069
- */
2070
2176
  {
2071
- name: "ntnyq/prettier/disabled",
2072
- files: [...disabledFiles, ...userDisabledFiles],
2177
+ name: "ntnyq/specials/config-file",
2178
+ files: [`**/*.config*.${GLOB_SRC_EXT}`],
2073
2179
  plugins: {
2074
- prettier: default17
2180
+ "import-x": default16,
2181
+ perfectionist: default21
2075
2182
  },
2076
2183
  rules: {
2077
- "prettier/prettier": "off"
2184
+ "@typescript-eslint/explicit-function-return-type": "off",
2185
+ "import-x/no-default-export": "off",
2186
+ "no-console": "off",
2187
+ "perfectionist/sort-objects": [
2188
+ "error",
2189
+ {
2190
+ ...PERFECTIONIST_COMMON_RULE_OPTIONS,
2191
+ ...PERFECTIONIST_EXTRA_RULE_OPTIONS,
2192
+ groups: PERFECTIONIST_SORT_OBJECTS_GROUPS
2193
+ }
2194
+ ],
2195
+ ...options.overridesConfigFileRules
2078
2196
  }
2079
2197
  }
2080
2198
  ];
2199
+ if (enableShadcnVue) {
2200
+ const shadcnOptions = resolveSubOptions(options, "shadcnVue");
2201
+ configs2.push({
2202
+ name: "ntnyq/specials/shadcn-vue",
2203
+ files: shadcnOptions.files || [
2204
+ "**/components/ui/**/*.ts",
2205
+ "**/components/ui/**/*.vue"
2206
+ ],
2207
+ rules: {
2208
+ "@typescript-eslint/consistent-type-imports": "off",
2209
+ "@typescript-eslint/no-unused-vars": "off",
2210
+ "import-x/consistent-type-specifier-style": "off",
2211
+ "vue/define-emits-declaration": "off",
2212
+ // Overrides rules
2213
+ ...shadcnOptions.overridesRules
2214
+ }
2215
+ });
2216
+ }
2217
+ if (options.specialCaseConfigs) {
2218
+ configs2.push(...options.specialCaseConfigs);
2219
+ }
2220
+ return configs2;
2081
2221
  };
2082
2222
 
2083
2223
  // src/configs/gitignore.ts
@@ -2318,7 +2458,7 @@ var configJavaScript = (options = {}) => [
2318
2458
  var configJSX = () => [
2319
2459
  {
2320
2460
  name: "ntnyq/jsx",
2321
- files: ["**/*.jsx"],
2461
+ files: [GLOB_JSX_ONLY],
2322
2462
  languageOptions: {
2323
2463
  parserOptions: {
2324
2464
  ecmaFeatures: {
@@ -2402,7 +2542,7 @@ var configTypeScript = (options = {}) => {
2402
2542
  files: files2,
2403
2543
  ignores: [...ignores],
2404
2544
  languageOptions: {
2405
- parser: parserTypeScript,
2545
+ parser,
2406
2546
  parserOptions: typescriptParserOptions
2407
2547
  }
2408
2548
  };
@@ -2413,7 +2553,7 @@ var configTypeScript = (options = {}) => {
2413
2553
  name: "ntnyq/ts/setup",
2414
2554
  plugins: {
2415
2555
  "@typescript-eslint": plugin,
2416
- antfu: default9
2556
+ antfu: default8
2417
2557
  }
2418
2558
  },
2419
2559
  ...enableTypeAwareLint ? [
@@ -2546,7 +2686,11 @@ var configTypeScript = (options = {}) => {
2546
2686
  "import-x/newline-after-import": "off",
2547
2687
  "import-x/no-duplicates": "off",
2548
2688
  "no-restricted-syntax": "off",
2549
- "no-use-before-define": "off"
2689
+ "no-use-before-define": "off",
2690
+ // `var` is special for type extend
2691
+ // e.g: extend globalThis
2692
+ "no-var": "off",
2693
+ "vars-on-top": "off"
2550
2694
  }
2551
2695
  }
2552
2696
  ];
@@ -2599,191 +2743,209 @@ var configGitHubAction = (options = {}) => {
2599
2743
  };
2600
2744
 
2601
2745
  // src/configs/perfectionist.ts
2602
- var INTERFACE_OR_OBJECT_TYPES_GROUPS = [
2603
- "required-property",
2604
- "optional-property",
2605
- "required-method",
2606
- "optional-method",
2607
- "required-multiline-property",
2608
- "optional-multiline-property",
2609
- "required-multiline-method",
2610
- "optional-multiline-method",
2611
- "unknown",
2612
- "index-signature",
2613
- "multiline-index-signature"
2614
- ];
2615
- var INTERSECTION_OR_UNION_TYPES_GROUPS = [
2616
- /**
2617
- * eg. 'foobar', 24, false
2618
- */
2619
- "literal",
2620
- /**
2621
- * eg. number, string
2622
- */
2623
- "keyword",
2624
- /**
2625
- * eg. FooBar
2626
- */
2627
- "named",
2628
- /**
2629
- * eg. Foo & Bar
2630
- */
2631
- "intersection",
2632
- /**
2633
- * eg. Foobar extends string ? Foo : Bar
2634
- */
2635
- "conditional",
2636
- /**
2637
- * eg. (...args: any[]) => void
2638
- */
2639
- "function",
2640
- /**
2641
- * eg. import('eslint').Linter
2642
- */
2643
- "import",
2644
- /**
2645
- * eg. { foo: string; bar: number; }
2646
- */
2647
- "object",
2648
- /**
2649
- * eg. keyof T
2650
- */
2651
- "operator",
2652
- /**
2653
- * eg. [string, number]
2654
- */
2655
- "tuple",
2656
- /**
2657
- * eg. Foo | Bar
2658
- */
2659
- "union",
2660
- /**
2661
- * eg. null | undefined
2662
- */
2663
- "nullish"
2664
- ];
2665
2746
  var configPerfectionist = (options = {}) => {
2666
2747
  const {
2667
- partitionByComment = ["@pg", "@perfectionist-group"],
2748
+ partitionByComment = PERFECTIONIST_EXTRA_RULE_OPTIONS.partitionByComment,
2668
2749
  sortConstants: enableSortConstants = true,
2669
2750
  sortEnums: enableSortEnums = true,
2670
2751
  sortTypes: enableSortTypes = true
2671
2752
  } = options;
2672
- function getCommonRuleOptions(options2 = {}) {
2673
- const ruleOptions = {
2674
- ignoreCase: true,
2675
- order: "asc",
2676
- type: "alphabetical",
2677
- ...options2.disableNewlinesBetween ? {} : { newlinesBetween: "ignore" },
2678
- ...options2.disableNewlinesBetween ? {} : { partitionByComment }
2679
- };
2680
- return ruleOptions;
2681
- }
2753
+ const commonRuleOptions = {
2754
+ ...PERFECTIONIST_COMMON_RULE_OPTIONS
2755
+ };
2756
+ const commonRuleOptionsWithNewlinesBetween = {
2757
+ ...commonRuleOptions,
2758
+ newlinesBetween: "ignore"
2759
+ };
2760
+ const commonRuleOptionsWithPartitionByComment = {
2761
+ ...commonRuleOptions,
2762
+ partitionByComment
2763
+ };
2764
+ const commonRuleOptionsWithBoth = {
2765
+ ...commonRuleOptionsWithNewlinesBetween,
2766
+ ...commonRuleOptionsWithPartitionByComment
2767
+ };
2768
+ const commonRules = {
2769
+ "perfectionist/sort-exports": [
2770
+ "error",
2771
+ {
2772
+ ...commonRuleOptionsWithPartitionByComment,
2773
+ groupKind: "values-first",
2774
+ type: "line-length"
2775
+ }
2776
+ ],
2777
+ "perfectionist/sort-imports": [
2778
+ "error",
2779
+ {
2780
+ ...commonRuleOptionsWithBoth,
2781
+ groups: PERFECTIONIST_SORT_IMPORTS_GROUPS,
2782
+ internalPattern: ["^~/.+", "^@/.+", "^#.+"]
2783
+ }
2784
+ ],
2785
+ "perfectionist/sort-named-exports": [
2786
+ "error",
2787
+ {
2788
+ ...commonRuleOptionsWithPartitionByComment,
2789
+ groupKind: "values-first",
2790
+ ignoreAlias: false
2791
+ }
2792
+ ],
2793
+ "perfectionist/sort-named-imports": [
2794
+ "error",
2795
+ {
2796
+ ...commonRuleOptionsWithPartitionByComment,
2797
+ groupKind: "values-first",
2798
+ ignoreAlias: false
2799
+ }
2800
+ ]
2801
+ };
2802
+ const sharedRules2 = {
2803
+ "perfectionist/sort-enums": [
2804
+ "error",
2805
+ {
2806
+ ...commonRuleOptionsWithBoth
2807
+ }
2808
+ ]
2809
+ };
2810
+ const sortEnumsRules = {
2811
+ "perfectionist/sort-modules": [
2812
+ "error",
2813
+ {
2814
+ ...commonRuleOptionsWithBoth
2815
+ }
2816
+ ]
2817
+ };
2818
+ const sortTypesRules = {
2819
+ "perfectionist/sort-heritage-clauses": [
2820
+ "error",
2821
+ {
2822
+ ...commonRuleOptions
2823
+ }
2824
+ ],
2825
+ "perfectionist/sort-interfaces": [
2826
+ "error",
2827
+ {
2828
+ ...commonRuleOptionsWithBoth,
2829
+ groups: PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS
2830
+ }
2831
+ ],
2832
+ "perfectionist/sort-intersection-types": [
2833
+ "error",
2834
+ {
2835
+ ...commonRuleOptionsWithBoth,
2836
+ groups: PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS
2837
+ }
2838
+ ],
2839
+ "perfectionist/sort-object-types": [
2840
+ "error",
2841
+ {
2842
+ ...commonRuleOptionsWithBoth,
2843
+ groups: PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS
2844
+ }
2845
+ ],
2846
+ "perfectionist/sort-union-types": [
2847
+ "error",
2848
+ {
2849
+ ...commonRuleOptionsWithBoth,
2850
+ groups: PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS
2851
+ }
2852
+ ]
2853
+ };
2854
+ const sortConstantsRules = {
2855
+ "perfectionist/sort-maps": [
2856
+ "error",
2857
+ {
2858
+ ...commonRuleOptionsWithBoth
2859
+ }
2860
+ ],
2861
+ "perfectionist/sort-objects": [
2862
+ "error",
2863
+ {
2864
+ ...commonRuleOptionsWithBoth,
2865
+ groups: PERFECTIONIST_SORT_OBJECTS_GROUPS
2866
+ }
2867
+ ],
2868
+ "perfectionist/sort-sets": [
2869
+ "error",
2870
+ {
2871
+ ...commonRuleOptionsWithBoth
2872
+ }
2873
+ ]
2874
+ };
2875
+ const extraRules = {
2876
+ "perfectionist/sort-array-includes": [
2877
+ "error",
2878
+ {
2879
+ ...commonRuleOptionsWithBoth,
2880
+ groups: ["literal", "spread"]
2881
+ }
2882
+ ],
2883
+ "perfectionist/sort-classes": [
2884
+ "error",
2885
+ {
2886
+ ...commonRuleOptionsWithBoth,
2887
+ groups: PERFECTIONIST_SORT_CLASSES_GROUPS
2888
+ }
2889
+ ],
2890
+ "perfectionist/sort-decorators": [
2891
+ "error",
2892
+ {
2893
+ ...commonRuleOptionsWithPartitionByComment
2894
+ }
2895
+ ],
2896
+ "perfectionist/sort-jsx-props": [
2897
+ "error",
2898
+ {
2899
+ ...commonRuleOptions,
2900
+ groups: ["shorthand", "multiline", "unknown"]
2901
+ }
2902
+ ],
2903
+ "perfectionist/sort-switch-case": [
2904
+ "error",
2905
+ {
2906
+ ...commonRuleOptions
2907
+ }
2908
+ ],
2909
+ "perfectionist/sort-variable-declarations": [
2910
+ "error",
2911
+ {
2912
+ ...commonRuleOptionsWithPartitionByComment
2913
+ }
2914
+ ]
2915
+ };
2682
2916
  const configs2 = [
2683
2917
  {
2684
- name: "ntnyq/perfectionist/common",
2918
+ name: options.all ? "ntnyq/perfectionist/all" : "ntnyq/perfectionist/common",
2685
2919
  plugins: {
2686
- perfectionist: default20
2920
+ perfectionist: default21
2687
2921
  },
2688
2922
  rules: {
2689
- "perfectionist/sort-exports": [
2690
- "error",
2691
- {
2692
- ...getCommonRuleOptions({
2693
- disableNewlinesBetween: true
2694
- }),
2695
- groupKind: "values-first",
2696
- type: "line-length"
2697
- }
2698
- ],
2699
- "perfectionist/sort-imports": [
2700
- "error",
2701
- {
2702
- ...getCommonRuleOptions(),
2703
- internalPattern: ["^~/.+", "^@/.+", "^#.+"],
2704
- groups: [
2705
- // Side effect style imports (e.g. 'normalize.css')
2706
- "side-effect-style",
2707
- // Styles (e.g. *.{css,scss,less})
2708
- "style",
2709
- // Node.js built-in modules. (e.g. fs, path)
2710
- "builtin",
2711
- // External modules installed in the project (e.g. vue, lodash)
2712
- "external",
2713
- // Internal modules (e.g. @/utils, @/components)
2714
- "internal",
2715
- // Modules from parent directory (e.g. ../utils)
2716
- "parent",
2717
- // Modules from the same directory (e.g. ./utils)
2718
- "sibling",
2719
- // Main file from the current directory (e.g. ./index)
2720
- "index",
2721
- // TypeScript object-imports (e.g. import log = console.log)
2722
- "object",
2723
- // Side effect imports (e.g. import 'babel-polyfill')
2724
- "side-effect",
2725
- /**
2726
- * Type import at the end
2727
- */
2728
- "builtin-type",
2729
- "external-type",
2730
- "internal-type",
2731
- "parent-type",
2732
- "sibling-type",
2733
- "index-type",
2734
- "type",
2735
- /**
2736
- * Imports that don’t fit into any other group
2737
- */
2738
- "unknown"
2739
- ]
2740
- }
2741
- ],
2742
- "perfectionist/sort-named-exports": [
2743
- "error",
2744
- {
2745
- ...getCommonRuleOptions({
2746
- disableNewlinesBetween: true
2747
- }),
2748
- groupKind: "values-first",
2749
- ignoreAlias: false
2750
- }
2751
- ],
2752
- "perfectionist/sort-named-imports": [
2753
- "error",
2754
- {
2755
- ...getCommonRuleOptions({
2756
- disableNewlinesBetween: true
2757
- }),
2758
- groupKind: "values-first",
2759
- ignoreAlias: false
2760
- }
2761
- ],
2923
+ ...commonRules,
2924
+ ...options.all ? {
2925
+ ...sharedRules2,
2926
+ ...sortEnumsRules,
2927
+ ...sortTypesRules,
2928
+ ...sortConstantsRules,
2929
+ ...extraRules
2930
+ } : {},
2762
2931
  // Overrides rules
2763
2932
  ...options.overrides
2764
2933
  }
2765
2934
  }
2766
2935
  ];
2936
+ if (options.all) {
2937
+ return configs2;
2938
+ }
2767
2939
  if (enableSortEnums) {
2768
2940
  configs2.push({
2769
2941
  name: "ntnyq/perfectionist/enums",
2770
2942
  files: [`**/enums/${GLOB_SRC}`, `**/enums.${GLOB_SRC_EXT}`],
2771
2943
  plugins: {
2772
- perfectionist: default20
2944
+ perfectionist: default21
2773
2945
  },
2774
2946
  rules: {
2775
- "perfectionist/sort-enums": [
2776
- "error",
2777
- {
2778
- ...getCommonRuleOptions()
2779
- }
2780
- ],
2781
- "perfectionist/sort-modules": [
2782
- "error",
2783
- {
2784
- ...getCommonRuleOptions()
2785
- }
2786
- ],
2947
+ ...sharedRules2,
2948
+ ...sortEnumsRules,
2787
2949
  // Overrides rules
2788
2950
  ...options.overridesEnumsRules
2789
2951
  }
@@ -2794,52 +2956,11 @@ var configPerfectionist = (options = {}) => {
2794
2956
  name: "ntnyq/perfectionist/types",
2795
2957
  files: [...GLOB_TYPES],
2796
2958
  plugins: {
2797
- perfectionist: default20
2959
+ perfectionist: default21
2798
2960
  },
2799
2961
  rules: {
2800
- "perfectionist/sort-heritage-clauses": [
2801
- "error",
2802
- {
2803
- ...getCommonRuleOptions({
2804
- disableNewlinesBetween: true,
2805
- disablePartitionByComment: true
2806
- })
2807
- }
2808
- ],
2809
- "perfectionist/sort-interfaces": [
2810
- "error",
2811
- {
2812
- ...getCommonRuleOptions(),
2813
- groups: INTERFACE_OR_OBJECT_TYPES_GROUPS
2814
- }
2815
- ],
2816
- "perfectionist/sort-intersection-types": [
2817
- "error",
2818
- {
2819
- ...getCommonRuleOptions(),
2820
- groups: INTERSECTION_OR_UNION_TYPES_GROUPS
2821
- }
2822
- ],
2823
- "perfectionist/sort-modules": [
2824
- "error",
2825
- {
2826
- ...getCommonRuleOptions()
2827
- }
2828
- ],
2829
- "perfectionist/sort-object-types": [
2830
- "error",
2831
- {
2832
- ...getCommonRuleOptions(),
2833
- groups: INTERFACE_OR_OBJECT_TYPES_GROUPS
2834
- }
2835
- ],
2836
- "perfectionist/sort-union-types": [
2837
- "error",
2838
- {
2839
- ...getCommonRuleOptions(),
2840
- groups: INTERSECTION_OR_UNION_TYPES_GROUPS
2841
- }
2842
- ],
2962
+ ...sharedRules2,
2963
+ ...sortTypesRules,
2843
2964
  // Overrides rules
2844
2965
  ...options.overridesTypesRules
2845
2966
  }
@@ -2850,40 +2971,11 @@ var configPerfectionist = (options = {}) => {
2850
2971
  name: "ntnyq/perfectionist/constants",
2851
2972
  files: [`**/constants/${GLOB_SRC}`, `**/constants.${GLOB_SRC_EXT}`],
2852
2973
  plugins: {
2853
- perfectionist: default20
2974
+ perfectionist: default21
2854
2975
  },
2855
2976
  rules: {
2856
- "perfectionist/sort-maps": [
2857
- "error",
2858
- {
2859
- ...getCommonRuleOptions()
2860
- }
2861
- ],
2862
- "perfectionist/sort-modules": [
2863
- "error",
2864
- {
2865
- ...getCommonRuleOptions()
2866
- }
2867
- ],
2868
- "perfectionist/sort-objects": [
2869
- "error",
2870
- {
2871
- ...getCommonRuleOptions(),
2872
- groups: [
2873
- "property",
2874
- "multiline-property",
2875
- "method",
2876
- "multiline-method",
2877
- "unknown"
2878
- ]
2879
- }
2880
- ],
2881
- "perfectionist/sort-sets": [
2882
- "error",
2883
- {
2884
- ...getCommonRuleOptions()
2885
- }
2886
- ],
2977
+ ...sharedRules2,
2978
+ ...sortConstantsRules,
2887
2979
  // Overrides rules
2888
2980
  ...options.overridesConstantsRules
2889
2981
  }
@@ -2897,7 +2989,7 @@ var configUnusedImports = (options = {}) => [
2897
2989
  {
2898
2990
  name: "ntnyq/unused-imports",
2899
2991
  plugins: {
2900
- "unused-imports": default21
2992
+ "unused-imports": default22
2901
2993
  },
2902
2994
  rules: {
2903
2995
  "@typescript-eslint/no-unused-vars": "off",
@@ -2926,10 +3018,10 @@ var configESLintComments = (options = {}) => [
2926
3018
  {
2927
3019
  name: "ntnyq/eslint-comments",
2928
3020
  plugins: {
2929
- "@eslint-community/eslint-comments": default22
3021
+ "@eslint-community/eslint-comments": default23
2930
3022
  },
2931
3023
  rules: {
2932
- ...default22.configs.recommended.rules,
3024
+ ...default23.configs.recommended.rules,
2933
3025
  "@eslint-community/eslint-comments/disable-enable-pair": [
2934
3026
  "error",
2935
3027
  { allowWholeFile: true }
@@ -2967,6 +3059,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
2967
3059
  depend: enableDepend = true,
2968
3060
  regexp: enableRegexp = true,
2969
3061
  unicorn: enableUnicorn = true,
3062
+ deMorgan: enableDeMorgan = true,
2970
3063
  prettier: enablePrettier = true,
2971
3064
  markdown: enableMarkdown = true,
2972
3065
  gitignore: enableGitIgnore = true,
@@ -3031,6 +3124,13 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3031
3124
  })
3032
3125
  );
3033
3126
  }
3127
+ if (enableDeMorgan) {
3128
+ configs2.push(
3129
+ configDeMorgan({
3130
+ overrides: getOverrides(options, "deMorgan")
3131
+ })
3132
+ );
3133
+ }
3034
3134
  if (enableRegexp) {
3035
3135
  configs2.push(
3036
3136
  configRegexp({
@@ -3060,6 +3160,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3060
3160
  if (enableYML) {
3061
3161
  configs2.push(
3062
3162
  configYml({
3163
+ ...resolveSubOptions(options, "yml"),
3063
3164
  overrides: getOverrides(options, "yml")
3064
3165
  })
3065
3166
  );
@@ -3067,6 +3168,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3067
3168
  if (enableTOML) {
3068
3169
  configs2.push(
3069
3170
  configToml({
3171
+ ...resolveSubOptions(options, "toml"),
3070
3172
  overrides: getOverrides(options, "toml")
3071
3173
  })
3072
3174
  );
@@ -3074,6 +3176,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3074
3176
  if (enableJSONC) {
3075
3177
  configs2.push(
3076
3178
  configJsonc({
3179
+ ...resolveSubOptions(options, "jsonc"),
3077
3180
  overrides: getOverrides(options, "jsonc")
3078
3181
  })
3079
3182
  );
@@ -3158,7 +3261,6 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3158
3261
  return composer;
3159
3262
  }
3160
3263
  export {
3161
- DEFAULT_PRETTIER_OPTIONS,
3162
3264
  GLOB_ALL_SRC,
3163
3265
  GLOB_ASTRO,
3164
3266
  GLOB_ASTRO_TS,
@@ -3173,6 +3275,7 @@ export {
3173
3275
  GLOB_JSON5,
3174
3276
  GLOB_JSONC,
3175
3277
  GLOB_JSX,
3278
+ GLOB_JSX_ONLY,
3176
3279
  GLOB_LESS,
3177
3280
  GLOB_LOCKFILE,
3178
3281
  GLOB_MARKDOWN,
@@ -3191,13 +3294,25 @@ export {
3191
3294
  GLOB_TEST,
3192
3295
  GLOB_TOML,
3193
3296
  GLOB_TS,
3297
+ GLOB_TSCONFIG_JSON,
3194
3298
  GLOB_TSX,
3299
+ GLOB_TSX_ONLY,
3195
3300
  GLOB_TYPES,
3301
+ GLOB_TYPE_TEST,
3196
3302
  GLOB_VUE,
3197
3303
  GLOB_YAML,
3304
+ PERFECTIONIST_COMMON_RULE_OPTIONS,
3305
+ PERFECTIONIST_EXTRA_RULE_OPTIONS,
3306
+ PERFECTIONIST_SORT_CLASSES_GROUPS,
3307
+ PERFECTIONIST_SORT_IMPORTS_GROUPS,
3308
+ PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS,
3309
+ PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS,
3310
+ PERFECTIONIST_SORT_OBJECTS_GROUPS,
3311
+ PRETTIER_DEFAULT_OPTIONS,
3198
3312
  combineConfigs,
3199
3313
  configAntfu,
3200
3314
  configCommand,
3315
+ configDeMorgan,
3201
3316
  configDepend,
3202
3317
  configESLintComments,
3203
3318
  configESLintPlugin,
@@ -3228,7 +3343,7 @@ export {
3228
3343
  configUnusedImports,
3229
3344
  configVue,
3230
3345
  configYml,
3231
- configs as configsTypescript,
3346
+ configs as configsTypeScript,
3232
3347
  createNodeResolver,
3233
3348
  createTypeScriptImportResolver,
3234
3349
  defineESLintConfig,
@@ -3247,22 +3362,23 @@ export {
3247
3362
  parserJsonc,
3248
3363
  parserPlain,
3249
3364
  parserToml,
3250
- parserTypeScript,
3365
+ parser as parserTypeScript,
3251
3366
  parserVue,
3252
3367
  parserYaml,
3253
- default9 as pluginAntfu,
3254
- default22 as pluginComments,
3368
+ default8 as pluginAntfu,
3369
+ default23 as pluginComments,
3370
+ default18 as pluginDeMorgan,
3255
3371
  pluginDepend,
3256
3372
  default12 as pluginFormat,
3257
- default19 as pluginGitHubAction,
3373
+ default20 as pluginGitHubAction,
3258
3374
  default16 as pluginImportX,
3259
- default10 as pluginJsdoc,
3260
- default11 as pluginJsonc,
3261
- default8 as pluginMarkdown,
3262
- default18 as pluginNoOnlyTests,
3375
+ default9 as pluginJsdoc,
3376
+ default10 as pluginJsonc,
3377
+ default7 as pluginMarkdown,
3378
+ default19 as pluginNoOnlyTests,
3263
3379
  default2 as pluginNode,
3264
- default20 as pluginPerfectionist,
3265
- default7 as pluginPinia,
3380
+ default21 as pluginPerfectionist,
3381
+ default11 as pluginPinia,
3266
3382
  default17 as pluginPrettier,
3267
3383
  pluginRegexp,
3268
3384
  default5 as pluginSvgo,
@@ -3270,12 +3386,12 @@ export {
3270
3386
  plugin as pluginTypeScript,
3271
3387
  default15 as pluginUnicorn,
3272
3388
  default13 as pluginUnoCSS,
3273
- default21 as pluginUnusedImports,
3389
+ default22 as pluginUnusedImports,
3274
3390
  default14 as pluginVitest,
3275
3391
  default3 as pluginVue,
3276
3392
  default4 as pluginYml,
3277
3393
  processorPassThrough,
3278
- default23 as processorVueBlocks,
3394
+ default24 as processorVueBlocks,
3279
3395
  resolveSubOptions,
3280
3396
  toArray
3281
3397
  };