@ntnyq/eslint-config 3.9.4 → 3.10.0
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/README.md +7 -1
- package/dist/index.cjs +93 -5
- package/dist/index.d.cts +714 -165
- package/dist/index.d.ts +714 -165
- package/dist/index.js +158 -75
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -34,29 +34,31 @@ var parserPlain = {
|
|
|
34
34
|
|
|
35
35
|
// src/eslint/plugins.ts
|
|
36
36
|
import * as pluginRegexp from "eslint-plugin-regexp";
|
|
37
|
+
import * as pluginDepend from "eslint-plugin-depend";
|
|
37
38
|
import { default as default2 } from "eslint-plugin-n";
|
|
38
39
|
import { default as default3 } from "eslint-plugin-vue";
|
|
39
40
|
import { default as default4 } from "eslint-plugin-es-x";
|
|
40
41
|
import { default as default5 } from "eslint-plugin-yml";
|
|
41
|
-
import { default as default6 } from "eslint-plugin-
|
|
42
|
-
import { default as default7 } from "eslint-plugin-
|
|
43
|
-
import { default as default8 } from "eslint-plugin-
|
|
44
|
-
import { default as default9 } from "
|
|
45
|
-
import { default as default10 } from "eslint
|
|
46
|
-
import { default as default11 } from "eslint-plugin-
|
|
47
|
-
import { default as default12 } from "eslint-plugin-
|
|
42
|
+
import { default as default6 } from "eslint-plugin-svgo";
|
|
43
|
+
import { default as default7 } from "eslint-plugin-toml";
|
|
44
|
+
import { default as default8 } from "eslint-plugin-pinia";
|
|
45
|
+
import { default as default9 } from "eslint-plugin-ntnyq";
|
|
46
|
+
import { default as default10 } from "@eslint/markdown";
|
|
47
|
+
import { default as default11 } from "eslint-plugin-antfu";
|
|
48
|
+
import { default as default12 } from "eslint-plugin-jsdoc";
|
|
49
|
+
import { default as default13 } from "eslint-plugin-jsonc";
|
|
48
50
|
import { plugin } from "typescript-eslint";
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
51
|
-
import { default as
|
|
52
|
-
import { default as
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as
|
|
57
|
-
import { default as
|
|
58
|
-
import { default as
|
|
59
|
-
import { default as
|
|
51
|
+
import { default as default14 } from "eslint-plugin-format";
|
|
52
|
+
import { default as default15 } from "@unocss/eslint-plugin";
|
|
53
|
+
import { default as default16 } from "@vitest/eslint-plugin";
|
|
54
|
+
import { default as default17 } from "eslint-plugin-unicorn";
|
|
55
|
+
import { default as default18 } from "eslint-plugin-import-x";
|
|
56
|
+
import { default as default19 } from "eslint-plugin-prettier";
|
|
57
|
+
import { default as default20 } from "@stylistic/eslint-plugin";
|
|
58
|
+
import { default as default21 } from "eslint-plugin-github-action";
|
|
59
|
+
import { default as default22 } from "eslint-plugin-perfectionist";
|
|
60
|
+
import { default as default23 } from "eslint-plugin-unused-imports";
|
|
61
|
+
import { default as default24 } from "@eslint-community/eslint-plugin-eslint-comments";
|
|
60
62
|
|
|
61
63
|
// src/eslint/configs.ts
|
|
62
64
|
import { configs } from "typescript-eslint";
|
|
@@ -64,7 +66,7 @@ import { configs } from "typescript-eslint";
|
|
|
64
66
|
// src/eslint/processors.ts
|
|
65
67
|
import { mergeProcessors } from "eslint-merge-processors";
|
|
66
68
|
import { processorPassThrough } from "eslint-merge-processors";
|
|
67
|
-
import { default as
|
|
69
|
+
import { default as default25 } from "eslint-processor-vue-blocks";
|
|
68
70
|
|
|
69
71
|
// src/globs.ts
|
|
70
72
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
@@ -89,6 +91,7 @@ var GLOB_POSTCSS = "**/*.{p,post}css";
|
|
|
89
91
|
var GLOB_JSON = "**/*.json";
|
|
90
92
|
var GLOB_JSON5 = "**/*.json5";
|
|
91
93
|
var GLOB_JSONC = "**/*.jsonc";
|
|
94
|
+
var GLOB_PACKAGE_JSON = "**/package.json";
|
|
92
95
|
var GLOB_VUE = "**/*.vue";
|
|
93
96
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
94
97
|
var GLOB_TOML = "**/*.toml";
|
|
@@ -374,7 +377,7 @@ var vue = (options = {}) => {
|
|
|
374
377
|
if (!sfcBlocks) return processorVueSFC;
|
|
375
378
|
return mergeProcessors2([
|
|
376
379
|
processorVueSFC,
|
|
377
|
-
|
|
380
|
+
default25({
|
|
378
381
|
...sfcBlocks,
|
|
379
382
|
blocks: {
|
|
380
383
|
styles: true,
|
|
@@ -928,7 +931,7 @@ var toml = (options = {}) => [
|
|
|
928
931
|
parser: parserToml
|
|
929
932
|
},
|
|
930
933
|
plugins: {
|
|
931
|
-
toml:
|
|
934
|
+
toml: default7
|
|
932
935
|
},
|
|
933
936
|
rules: {
|
|
934
937
|
"toml/keys-order": "error",
|
|
@@ -973,23 +976,34 @@ var vitest = (options = {}) => [
|
|
|
973
976
|
{
|
|
974
977
|
name: "ntnyq/vitest",
|
|
975
978
|
plugins: {
|
|
976
|
-
vitest:
|
|
979
|
+
vitest: default16
|
|
977
980
|
},
|
|
978
981
|
files: [...GLOB_TEST],
|
|
979
982
|
rules: {
|
|
980
|
-
...
|
|
983
|
+
...default16.configs.recommended.rules,
|
|
981
984
|
// Overrides rules
|
|
982
985
|
...options.overridesVitestRules
|
|
983
986
|
}
|
|
984
987
|
}
|
|
985
988
|
];
|
|
986
989
|
|
|
990
|
+
// src/configs/svgo.ts
|
|
991
|
+
import { config as createSVGOConfig } from "eslint-plugin-svgo";
|
|
992
|
+
var svgo = (options = {}) => [
|
|
993
|
+
// TODO: remove after fix type
|
|
994
|
+
// @ts-expect-error type
|
|
995
|
+
{
|
|
996
|
+
...createSVGOConfig(options),
|
|
997
|
+
name: "ntnyq/svgo"
|
|
998
|
+
}
|
|
999
|
+
];
|
|
1000
|
+
|
|
987
1001
|
// src/configs/antfu.ts
|
|
988
1002
|
var antfu = (options = {}) => [
|
|
989
1003
|
{
|
|
990
1004
|
name: "ntnyq/antfu",
|
|
991
1005
|
plugins: {
|
|
992
|
-
antfu:
|
|
1006
|
+
antfu: default11
|
|
993
1007
|
},
|
|
994
1008
|
rules: {
|
|
995
1009
|
// required `object-curly-newline` to be disabled
|
|
@@ -1016,7 +1030,7 @@ var jsdoc = (options = {}) => [
|
|
|
1016
1030
|
{
|
|
1017
1031
|
name: "ntnyq/jsdoc",
|
|
1018
1032
|
plugins: {
|
|
1019
|
-
jsdoc:
|
|
1033
|
+
jsdoc: default12
|
|
1020
1034
|
},
|
|
1021
1035
|
rules: {
|
|
1022
1036
|
// Disabled rules
|
|
@@ -1245,13 +1259,13 @@ var jsonc = (options = {}) => [
|
|
|
1245
1259
|
name: "ntnyq/jsonc",
|
|
1246
1260
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
1247
1261
|
plugins: {
|
|
1248
|
-
jsonc:
|
|
1262
|
+
jsonc: default13
|
|
1249
1263
|
},
|
|
1250
1264
|
languageOptions: {
|
|
1251
1265
|
parser: parserJsonc
|
|
1252
1266
|
},
|
|
1253
1267
|
rules: {
|
|
1254
|
-
...
|
|
1268
|
+
...default13.configs["recommended-with-jsonc"].rules,
|
|
1255
1269
|
"jsonc/no-octal-escape": "error",
|
|
1256
1270
|
"jsonc/indent": ["error", 2],
|
|
1257
1271
|
"jsonc/comma-style": ["error", "last"],
|
|
@@ -1292,7 +1306,7 @@ var pinia = (options = {}) => {
|
|
|
1292
1306
|
name: "ntnyq/pinia",
|
|
1293
1307
|
files,
|
|
1294
1308
|
plugins: {
|
|
1295
|
-
pinia:
|
|
1309
|
+
pinia: default8
|
|
1296
1310
|
},
|
|
1297
1311
|
rules: {
|
|
1298
1312
|
"pinia/prefer-single-store-per-file": "error",
|
|
@@ -1320,7 +1334,7 @@ var ntnyq = (options = {}) => [
|
|
|
1320
1334
|
{
|
|
1321
1335
|
name: "ntnyq/ntnyq",
|
|
1322
1336
|
plugins: {
|
|
1323
|
-
ntnyq:
|
|
1337
|
+
ntnyq: default9
|
|
1324
1338
|
},
|
|
1325
1339
|
rules: {
|
|
1326
1340
|
"ntnyq/no-member-accessibility": "error",
|
|
@@ -1330,6 +1344,47 @@ var ntnyq = (options = {}) => [
|
|
|
1330
1344
|
}
|
|
1331
1345
|
];
|
|
1332
1346
|
|
|
1347
|
+
// src/configs/depend.ts
|
|
1348
|
+
var depend = (options = {}) => {
|
|
1349
|
+
const {
|
|
1350
|
+
files = [GLOB_SRC],
|
|
1351
|
+
// check package.json file
|
|
1352
|
+
packageJson: enableCheckPackageJson = true
|
|
1353
|
+
} = options;
|
|
1354
|
+
const configs2 = [
|
|
1355
|
+
{
|
|
1356
|
+
name: "ntnyq/depend",
|
|
1357
|
+
files,
|
|
1358
|
+
plugins: {
|
|
1359
|
+
depend: pluginDepend
|
|
1360
|
+
},
|
|
1361
|
+
rules: {
|
|
1362
|
+
"depend/ban-dependencies": "error",
|
|
1363
|
+
// Overrides rules
|
|
1364
|
+
...options.overrides
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
];
|
|
1368
|
+
if (enableCheckPackageJson) {
|
|
1369
|
+
configs2.push({
|
|
1370
|
+
name: "ntnyq/depend/package-json",
|
|
1371
|
+
files: [GLOB_PACKAGE_JSON],
|
|
1372
|
+
plugins: {
|
|
1373
|
+
depend: pluginDepend
|
|
1374
|
+
},
|
|
1375
|
+
languageOptions: {
|
|
1376
|
+
parser: parserJsonc
|
|
1377
|
+
},
|
|
1378
|
+
rules: {
|
|
1379
|
+
"depend/ban-dependencies": "error",
|
|
1380
|
+
// Overrides rules
|
|
1381
|
+
...options.overrides
|
|
1382
|
+
}
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
return configs2;
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1333
1388
|
// src/configs/regexp.ts
|
|
1334
1389
|
var regexp = (options = {}) => {
|
|
1335
1390
|
const recommendedConfig = pluginRegexp.configs["flat/recommended"];
|
|
@@ -1361,7 +1416,7 @@ var unocss = (options = {}) => [
|
|
|
1361
1416
|
{
|
|
1362
1417
|
name: "ntnyq/unocss",
|
|
1363
1418
|
plugins: {
|
|
1364
|
-
unocss:
|
|
1419
|
+
unocss: default15
|
|
1365
1420
|
},
|
|
1366
1421
|
rules: {
|
|
1367
1422
|
"unocss/order": "error",
|
|
@@ -1496,7 +1551,7 @@ var format = (options = {}) => {
|
|
|
1496
1551
|
{
|
|
1497
1552
|
name: "ntnyq/format/setup",
|
|
1498
1553
|
plugins: {
|
|
1499
|
-
format:
|
|
1554
|
+
format: default14
|
|
1500
1555
|
}
|
|
1501
1556
|
}
|
|
1502
1557
|
];
|
|
@@ -1641,12 +1696,12 @@ var ignores = (customIgnores = []) => [
|
|
|
1641
1696
|
];
|
|
1642
1697
|
|
|
1643
1698
|
// src/configs/importX.ts
|
|
1644
|
-
var { createNodeResolver } =
|
|
1699
|
+
var { createNodeResolver } = default18;
|
|
1645
1700
|
var importX = (options = {}) => [
|
|
1646
1701
|
{
|
|
1647
1702
|
name: "ntnyq/import-x",
|
|
1648
1703
|
plugins: {
|
|
1649
|
-
"import-x":
|
|
1704
|
+
"import-x": default18
|
|
1650
1705
|
},
|
|
1651
1706
|
settings: {
|
|
1652
1707
|
"import-x/resolver-next": [
|
|
@@ -1689,7 +1744,7 @@ var unicorn = (options = {}) => [
|
|
|
1689
1744
|
{
|
|
1690
1745
|
name: "ntnyq/unicorn",
|
|
1691
1746
|
plugins: {
|
|
1692
|
-
unicorn:
|
|
1747
|
+
unicorn: default17
|
|
1693
1748
|
},
|
|
1694
1749
|
rules: {
|
|
1695
1750
|
"unicorn/escape-case": "error",
|
|
@@ -1811,8 +1866,8 @@ var specials = (options = {}) => [
|
|
|
1811
1866
|
name: "ntnyq/specials/config-file",
|
|
1812
1867
|
files: [`**/*.config*.${GLOB_SRC_EXT}`],
|
|
1813
1868
|
plugins: {
|
|
1814
|
-
"import-x":
|
|
1815
|
-
perfectionist:
|
|
1869
|
+
"import-x": default18,
|
|
1870
|
+
perfectionist: default22
|
|
1816
1871
|
},
|
|
1817
1872
|
rules: {
|
|
1818
1873
|
"no-console": "off",
|
|
@@ -1840,10 +1895,10 @@ var comments = (options = {}) => [
|
|
|
1840
1895
|
{
|
|
1841
1896
|
name: "ntnyq/eslint-comments",
|
|
1842
1897
|
plugins: {
|
|
1843
|
-
"@eslint-community/eslint-comments":
|
|
1898
|
+
"@eslint-community/eslint-comments": default24
|
|
1844
1899
|
},
|
|
1845
1900
|
rules: {
|
|
1846
|
-
...
|
|
1901
|
+
...default24.configs.recommended.rules,
|
|
1847
1902
|
"@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
|
|
1848
1903
|
// Overrides rules
|
|
1849
1904
|
...options.overrides
|
|
@@ -1853,10 +1908,10 @@ var comments = (options = {}) => [
|
|
|
1853
1908
|
|
|
1854
1909
|
// src/configs/markdown.ts
|
|
1855
1910
|
var markdown = (options = {}) => {
|
|
1856
|
-
if (!Array.isArray(
|
|
1911
|
+
if (!Array.isArray(default10.configs?.processor)) return [];
|
|
1857
1912
|
const { files = [`${GLOB_MARKDOWN}/${GLOB_SRC}`], extensions = [] } = options;
|
|
1858
1913
|
return [
|
|
1859
|
-
...
|
|
1914
|
+
...default10.configs.processor.map((config) => ({
|
|
1860
1915
|
...config,
|
|
1861
1916
|
name: `ntnyq/${config.name}`
|
|
1862
1917
|
})),
|
|
@@ -1865,7 +1920,7 @@ var markdown = (options = {}) => {
|
|
|
1865
1920
|
files,
|
|
1866
1921
|
ignores: [GLOB_MARKDOWN_NESTED],
|
|
1867
1922
|
processor: mergeProcessors([
|
|
1868
|
-
|
|
1923
|
+
default10.processors.markdown,
|
|
1869
1924
|
// Just pass through processor
|
|
1870
1925
|
processorPassThrough
|
|
1871
1926
|
])
|
|
@@ -1930,7 +1985,7 @@ var prettier = (options = {}) => {
|
|
|
1930
1985
|
{
|
|
1931
1986
|
name: "ntnyq/prettier",
|
|
1932
1987
|
plugins: {
|
|
1933
|
-
prettier:
|
|
1988
|
+
prettier: default19
|
|
1934
1989
|
},
|
|
1935
1990
|
rules: {
|
|
1936
1991
|
"vue/array-bracket-newline": "off",
|
|
@@ -1970,7 +2025,7 @@ var prettier = (options = {}) => {
|
|
|
1970
2025
|
"vue/space-infix-ops": "off",
|
|
1971
2026
|
"vue/space-unary-ops": "off",
|
|
1972
2027
|
"vue/template-curly-spacing": "off",
|
|
1973
|
-
...
|
|
2028
|
+
...default19.configs.recommended.rules,
|
|
1974
2029
|
"prettier/prettier": options.severity || options.level || "warn",
|
|
1975
2030
|
// Overrides rules
|
|
1976
2031
|
...options.overrides
|
|
@@ -1983,7 +2038,7 @@ var prettier = (options = {}) => {
|
|
|
1983
2038
|
name: "ntnyq/prettier/disabled",
|
|
1984
2039
|
files: [...disabledFiles, ...userDisabledFiles],
|
|
1985
2040
|
plugins: {
|
|
1986
|
-
prettier:
|
|
2041
|
+
prettier: default19
|
|
1987
2042
|
},
|
|
1988
2043
|
rules: {
|
|
1989
2044
|
"prettier/prettier": "off"
|
|
@@ -1997,7 +2052,7 @@ var stylistic = (options = {}) => [
|
|
|
1997
2052
|
{
|
|
1998
2053
|
name: "ntnyq/stylistic",
|
|
1999
2054
|
plugins: {
|
|
2000
|
-
"@stylistic":
|
|
2055
|
+
"@stylistic": default20
|
|
2001
2056
|
},
|
|
2002
2057
|
rules: {
|
|
2003
2058
|
// Only rules are not conflicted with Prettier
|
|
@@ -2331,7 +2386,7 @@ var typescript = (options = {}) => {
|
|
|
2331
2386
|
name: "ntnyq/ts/setup",
|
|
2332
2387
|
plugins: {
|
|
2333
2388
|
"@typescript-eslint": plugin,
|
|
2334
|
-
antfu:
|
|
2389
|
+
antfu: default11
|
|
2335
2390
|
}
|
|
2336
2391
|
},
|
|
2337
2392
|
...enableTypeAwareLint ? [
|
|
@@ -2555,7 +2610,7 @@ var perfectionist = (options = {}) => {
|
|
|
2555
2610
|
{
|
|
2556
2611
|
name: "ntnyq/perfectionist/common",
|
|
2557
2612
|
plugins: {
|
|
2558
|
-
perfectionist:
|
|
2613
|
+
perfectionist: default22
|
|
2559
2614
|
},
|
|
2560
2615
|
rules: {
|
|
2561
2616
|
"perfectionist/sort-imports": [
|
|
@@ -2601,14 +2656,17 @@ var perfectionist = (options = {}) => {
|
|
|
2601
2656
|
type: "natural",
|
|
2602
2657
|
ignoreCase: true,
|
|
2603
2658
|
internalPattern: ["^~/.+", "^@/.+", "^#.+"],
|
|
2604
|
-
newlinesBetween: "ignore"
|
|
2659
|
+
newlinesBetween: "ignore",
|
|
2660
|
+
partitionByComment: true
|
|
2605
2661
|
}
|
|
2606
2662
|
],
|
|
2607
2663
|
"perfectionist/sort-exports": [
|
|
2608
2664
|
"error",
|
|
2609
2665
|
{
|
|
2610
2666
|
order: "asc",
|
|
2611
|
-
type: "line-length"
|
|
2667
|
+
type: "line-length",
|
|
2668
|
+
groupKind: "values-first",
|
|
2669
|
+
partitionByComment: true
|
|
2612
2670
|
}
|
|
2613
2671
|
],
|
|
2614
2672
|
"perfectionist/sort-named-exports": [
|
|
@@ -2617,7 +2675,8 @@ var perfectionist = (options = {}) => {
|
|
|
2617
2675
|
type: "alphabetical",
|
|
2618
2676
|
order: "asc",
|
|
2619
2677
|
ignoreCase: true,
|
|
2620
|
-
groupKind: "values-first"
|
|
2678
|
+
groupKind: "values-first",
|
|
2679
|
+
partitionByComment: true
|
|
2621
2680
|
}
|
|
2622
2681
|
],
|
|
2623
2682
|
"perfectionist/sort-named-imports": [
|
|
@@ -2627,7 +2686,8 @@ var perfectionist = (options = {}) => {
|
|
|
2627
2686
|
order: "asc",
|
|
2628
2687
|
ignoreCase: true,
|
|
2629
2688
|
ignoreAlias: false,
|
|
2630
|
-
groupKind: "values-first"
|
|
2689
|
+
groupKind: "values-first",
|
|
2690
|
+
partitionByComment: true
|
|
2631
2691
|
}
|
|
2632
2692
|
],
|
|
2633
2693
|
// Overrides rules
|
|
@@ -2640,7 +2700,7 @@ var perfectionist = (options = {}) => {
|
|
|
2640
2700
|
name: "ntnyq/perfectionist/enums",
|
|
2641
2701
|
files: [`**/enums/${GLOB_SRC}`, `**/enums.${GLOB_SRC_EXT}`],
|
|
2642
2702
|
plugins: {
|
|
2643
|
-
perfectionist:
|
|
2703
|
+
perfectionist: default22
|
|
2644
2704
|
},
|
|
2645
2705
|
rules: {
|
|
2646
2706
|
"perfectionist/sort-enums": [
|
|
@@ -2669,7 +2729,7 @@ var perfectionist = (options = {}) => {
|
|
|
2669
2729
|
name: "ntnyq/perfectionist/types",
|
|
2670
2730
|
files: [...GLOB_TYPES],
|
|
2671
2731
|
plugins: {
|
|
2672
|
-
perfectionist:
|
|
2732
|
+
perfectionist: default22
|
|
2673
2733
|
},
|
|
2674
2734
|
rules: {
|
|
2675
2735
|
"perfectionist/sort-heritage-clauses": [
|
|
@@ -2733,7 +2793,7 @@ var perfectionist = (options = {}) => {
|
|
|
2733
2793
|
name: "ntnyq/perfectionist/constants",
|
|
2734
2794
|
files: [`**/constants/${GLOB_SRC}`, `**/constants.${GLOB_SRC_EXT}`],
|
|
2735
2795
|
plugins: {
|
|
2736
|
-
perfectionist:
|
|
2796
|
+
perfectionist: default22
|
|
2737
2797
|
},
|
|
2738
2798
|
rules: {
|
|
2739
2799
|
"perfectionist/sort-maps": [
|
|
@@ -2782,7 +2842,7 @@ var unusedImports = (options = {}) => [
|
|
|
2782
2842
|
{
|
|
2783
2843
|
name: "ntnyq/unused-imports",
|
|
2784
2844
|
plugins: {
|
|
2785
|
-
"unused-imports":
|
|
2845
|
+
"unused-imports": default23
|
|
2786
2846
|
},
|
|
2787
2847
|
rules: {
|
|
2788
2848
|
"@typescript-eslint/no-unused-vars": "off",
|
|
@@ -2829,6 +2889,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2829
2889
|
toml: enableTOML = true,
|
|
2830
2890
|
jsonc: enableJSONC = true,
|
|
2831
2891
|
antfu: enableAntfu = true,
|
|
2892
|
+
depend: enableDepend = true,
|
|
2832
2893
|
regexp: enableRegexp = true,
|
|
2833
2894
|
unicorn: enableUnicorn = true,
|
|
2834
2895
|
prettier: enablePrettier = true,
|
|
@@ -2836,7 +2897,9 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2836
2897
|
stylistic: enableStylistic = true,
|
|
2837
2898
|
gitignore: enableGitIgnore = true,
|
|
2838
2899
|
githubAction: enableGitHubAction = true,
|
|
2839
|
-
perfectionist: enablePerfectionist = true
|
|
2900
|
+
perfectionist: enablePerfectionist = true,
|
|
2901
|
+
// disabled by default
|
|
2902
|
+
svgo: enableSVGO = false
|
|
2840
2903
|
} = options;
|
|
2841
2904
|
const configs2 = [];
|
|
2842
2905
|
if (enableVue) {
|
|
@@ -2989,6 +3052,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2989
3052
|
})
|
|
2990
3053
|
);
|
|
2991
3054
|
}
|
|
3055
|
+
if (enableDepend) {
|
|
3056
|
+
configs2.push(
|
|
3057
|
+
...depend({
|
|
3058
|
+
...resolveSubOptions(options, "depend"),
|
|
3059
|
+
overrides: getOverrides(options, "depend")
|
|
3060
|
+
})
|
|
3061
|
+
);
|
|
3062
|
+
}
|
|
2992
3063
|
if (enableGitHubAction) {
|
|
2993
3064
|
configs2.push(
|
|
2994
3065
|
...githubAction({
|
|
@@ -2996,6 +3067,13 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2996
3067
|
})
|
|
2997
3068
|
);
|
|
2998
3069
|
}
|
|
3070
|
+
if (enableSVGO) {
|
|
3071
|
+
configs2.push(
|
|
3072
|
+
...svgo({
|
|
3073
|
+
...resolveSubOptions(options, "svgo")
|
|
3074
|
+
})
|
|
3075
|
+
);
|
|
3076
|
+
}
|
|
2999
3077
|
const configSpecials = specials({
|
|
3000
3078
|
...resolveSubOptions(options, "specials")
|
|
3001
3079
|
});
|
|
@@ -3033,6 +3111,7 @@ export {
|
|
|
3033
3111
|
GLOB_MARKDOWN_CODE,
|
|
3034
3112
|
GLOB_MARKDOWN_NESTED,
|
|
3035
3113
|
GLOB_NODE_MODULES,
|
|
3114
|
+
GLOB_PACKAGE_JSON,
|
|
3036
3115
|
GLOB_PINIA_STORE,
|
|
3037
3116
|
GLOB_POSTCSS,
|
|
3038
3117
|
GLOB_SCSS,
|
|
@@ -3051,6 +3130,7 @@ export {
|
|
|
3051
3130
|
command,
|
|
3052
3131
|
comments,
|
|
3053
3132
|
defineESLintConfig,
|
|
3133
|
+
depend,
|
|
3054
3134
|
esX,
|
|
3055
3135
|
format,
|
|
3056
3136
|
getOverrides,
|
|
@@ -3082,38 +3162,41 @@ export {
|
|
|
3082
3162
|
parserYaml,
|
|
3083
3163
|
perfectionist,
|
|
3084
3164
|
pinia,
|
|
3085
|
-
|
|
3086
|
-
|
|
3165
|
+
default11 as pluginAntfu,
|
|
3166
|
+
default24 as pluginComments,
|
|
3167
|
+
pluginDepend,
|
|
3087
3168
|
default4 as pluginEsX,
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3169
|
+
default14 as pluginFormat,
|
|
3170
|
+
default21 as pluginGitHubAction,
|
|
3171
|
+
default18 as pluginImportX,
|
|
3172
|
+
default12 as pluginJsdoc,
|
|
3173
|
+
default13 as pluginJsonc,
|
|
3174
|
+
default10 as pluginMarkdown,
|
|
3094
3175
|
default2 as pluginNode,
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3176
|
+
default9 as pluginNtnyq,
|
|
3177
|
+
default22 as pluginPerfectionist,
|
|
3178
|
+
default8 as pluginPinia,
|
|
3179
|
+
default19 as pluginPrettier,
|
|
3099
3180
|
pluginRegexp,
|
|
3100
|
-
|
|
3101
|
-
default6 as
|
|
3181
|
+
default20 as pluginStylistic,
|
|
3182
|
+
default6 as pluginSvgo,
|
|
3183
|
+
default7 as pluginToml,
|
|
3102
3184
|
plugin as pluginTypeScript,
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3185
|
+
default17 as pluginUnicorn,
|
|
3186
|
+
default15 as pluginUnoCSS,
|
|
3187
|
+
default23 as pluginUnusedImports,
|
|
3188
|
+
default16 as pluginVitest,
|
|
3107
3189
|
default3 as pluginVue,
|
|
3108
3190
|
default5 as pluginYaml,
|
|
3109
3191
|
prettier,
|
|
3110
3192
|
processorPassThrough,
|
|
3111
|
-
|
|
3193
|
+
default25 as processorVueBlocks,
|
|
3112
3194
|
regexp,
|
|
3113
3195
|
resolveSubOptions,
|
|
3114
3196
|
sort,
|
|
3115
3197
|
specials,
|
|
3116
3198
|
stylistic,
|
|
3199
|
+
svgo,
|
|
3117
3200
|
test,
|
|
3118
3201
|
toArray,
|
|
3119
3202
|
toml,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
5
|
-
"packageManager": "pnpm@9.15.
|
|
4
|
+
"version": "3.10.0",
|
|
5
|
+
"packageManager": "pnpm@9.15.1",
|
|
6
6
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"eslint",
|
|
@@ -40,14 +40,13 @@
|
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "pnpm run generate:type && tsup",
|
|
43
|
-
"clean": "rimraf dist",
|
|
44
43
|
"dev": "tsup --watch src",
|
|
45
44
|
"generate:site": "tsx scripts/generateSite.ts",
|
|
46
45
|
"generate:type": "tsx scripts/generateType.ts",
|
|
47
46
|
"lint": "eslint --flag unstable_ts_config .",
|
|
48
47
|
"prepare": "husky",
|
|
49
48
|
"release": "run-s release:check release:version",
|
|
50
|
-
"release:check": "run-s
|
|
49
|
+
"release:check": "run-s build lint typecheck",
|
|
51
50
|
"release:version": "bumpp && npm publish",
|
|
52
51
|
"test": "vitest",
|
|
53
52
|
"typecheck": "tsc --noEmit"
|
|
@@ -61,24 +60,26 @@
|
|
|
61
60
|
"@eslint/markdown": "^6.2.1",
|
|
62
61
|
"@stylistic/eslint-plugin": "^2.12.1",
|
|
63
62
|
"@unocss/eslint-plugin": "^0.65.2",
|
|
64
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
63
|
+
"@vitest/eslint-plugin": "^1.1.20",
|
|
65
64
|
"eslint-config-flat-gitignore": "^0.3.0",
|
|
66
65
|
"eslint-flat-config-utils": "^0.4.0",
|
|
67
66
|
"eslint-merge-processors": "^0.1.0",
|
|
68
67
|
"eslint-plugin-antfu": "^2.7.0",
|
|
69
68
|
"eslint-plugin-command": "^0.2.7",
|
|
69
|
+
"eslint-plugin-depend": "^0.12.0",
|
|
70
70
|
"eslint-plugin-es-x": "^8.4.1",
|
|
71
71
|
"eslint-plugin-format": "^0.1.3",
|
|
72
72
|
"eslint-plugin-github-action": "^0.0.12",
|
|
73
73
|
"eslint-plugin-import-x": "^4.6.1",
|
|
74
74
|
"eslint-plugin-jsdoc": "^50.6.1",
|
|
75
75
|
"eslint-plugin-jsonc": "^2.18.2",
|
|
76
|
-
"eslint-plugin-n": "^17.15.
|
|
76
|
+
"eslint-plugin-n": "^17.15.1",
|
|
77
77
|
"eslint-plugin-ntnyq": "^0.7.1",
|
|
78
|
-
"eslint-plugin-perfectionist": "^4.
|
|
78
|
+
"eslint-plugin-perfectionist": "^4.4.0",
|
|
79
79
|
"eslint-plugin-pinia": "^0.4.1",
|
|
80
80
|
"eslint-plugin-prettier": "^5.2.1",
|
|
81
81
|
"eslint-plugin-regexp": "^2.7.0",
|
|
82
|
+
"eslint-plugin-svgo": "^0.1.1",
|
|
82
83
|
"eslint-plugin-toml": "^0.12.0",
|
|
83
84
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
84
85
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
@@ -104,11 +105,10 @@
|
|
|
104
105
|
"jiti": "^2.4.2",
|
|
105
106
|
"nano-staged": "^0.8.0",
|
|
106
107
|
"npm-run-all2": "^7.0.2",
|
|
107
|
-
"rimraf": "^6.0.1",
|
|
108
108
|
"tsup": "^8.3.5",
|
|
109
109
|
"tsx": "^4.19.2",
|
|
110
110
|
"typescript": "^5.7.2",
|
|
111
|
-
"vitest": "^3.0.0-beta.
|
|
111
|
+
"vitest": "^3.0.0-beta.3",
|
|
112
112
|
"zx": "^8.2.4"
|
|
113
113
|
},
|
|
114
114
|
"engines": {
|