@ntnyq/eslint-config 3.7.2 → 3.8.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 +1 -1
- package/dist/index.cjs +112 -52
- package/dist/index.d.cts +228 -175
- package/dist/index.d.ts +228 -175
- package/dist/index.js +110 -53
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -47,8 +47,8 @@ import { plugin } from "typescript-eslint";
|
|
|
47
47
|
import { default as default11 } from "eslint-plugin-format";
|
|
48
48
|
import { default as default12 } from "@unocss/eslint-plugin";
|
|
49
49
|
import { default as default13 } from "@vitest/eslint-plugin";
|
|
50
|
-
import { default as default14 } from "eslint-plugin-
|
|
51
|
-
import { default as default15 } from "eslint-plugin-
|
|
50
|
+
import { default as default14 } from "eslint-plugin-unicorn";
|
|
51
|
+
import { default as default15 } from "eslint-plugin-import-x";
|
|
52
52
|
import { default as default16 } from "eslint-plugin-prettier";
|
|
53
53
|
import { default as default17 } from "@stylistic/eslint-plugin";
|
|
54
54
|
import { default as default18 } from "eslint-plugin-github-action";
|
|
@@ -1534,31 +1534,31 @@ var ignores = (customIgnores = []) => [
|
|
|
1534
1534
|
}
|
|
1535
1535
|
];
|
|
1536
1536
|
|
|
1537
|
-
// src/configs/
|
|
1538
|
-
var
|
|
1537
|
+
// src/configs/importX.ts
|
|
1538
|
+
var importX = (options = {}) => [
|
|
1539
1539
|
{
|
|
1540
|
-
name: "ntnyq/
|
|
1540
|
+
name: "ntnyq/import-x",
|
|
1541
1541
|
plugins: {
|
|
1542
|
-
import:
|
|
1542
|
+
"import-x": default15
|
|
1543
1543
|
},
|
|
1544
1544
|
settings: {
|
|
1545
|
-
"import/resolver": {
|
|
1545
|
+
"import-x/resolver": {
|
|
1546
1546
|
node: { extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts"] }
|
|
1547
1547
|
}
|
|
1548
1548
|
},
|
|
1549
1549
|
rules: {
|
|
1550
|
-
"import/no-unresolved": "off",
|
|
1551
|
-
"import/no-absolute-path": "off",
|
|
1552
|
-
"import/no-named-as-default-member": "off",
|
|
1553
|
-
"import/no-named-default": "off",
|
|
1550
|
+
"import-x/no-unresolved": "off",
|
|
1551
|
+
"import-x/no-absolute-path": "off",
|
|
1552
|
+
"import-x/no-named-as-default-member": "off",
|
|
1553
|
+
"import-x/no-named-default": "off",
|
|
1554
1554
|
// disabled in favor or `perfectionist/sort-imports`
|
|
1555
|
-
"import/order": "off",
|
|
1556
|
-
"import/first": "error",
|
|
1557
|
-
"import/export": "error",
|
|
1558
|
-
"import/no-self-import": "error",
|
|
1559
|
-
"import/no-duplicates": "error",
|
|
1560
|
-
"import/no-mutable-exports": "error",
|
|
1561
|
-
"import/newline-after-import": "error",
|
|
1555
|
+
"import-x/order": "off",
|
|
1556
|
+
"import-x/first": "error",
|
|
1557
|
+
"import-x/export": "error",
|
|
1558
|
+
"import-x/no-self-import": "error",
|
|
1559
|
+
"import-x/no-duplicates": "error",
|
|
1560
|
+
"import-x/no-mutable-exports": "error",
|
|
1561
|
+
"import-x/newline-after-import": "error",
|
|
1562
1562
|
// Overrides rules
|
|
1563
1563
|
...options.overrides
|
|
1564
1564
|
}
|
|
@@ -1580,7 +1580,7 @@ var unicorn = (options = {}) => [
|
|
|
1580
1580
|
{
|
|
1581
1581
|
name: "ntnyq/unicorn",
|
|
1582
1582
|
plugins: {
|
|
1583
|
-
unicorn:
|
|
1583
|
+
unicorn: default14
|
|
1584
1584
|
},
|
|
1585
1585
|
rules: {
|
|
1586
1586
|
"unicorn/escape-case": "error",
|
|
@@ -1702,12 +1702,12 @@ var specials = (options = {}) => [
|
|
|
1702
1702
|
name: "ntnyq/specials/config-file",
|
|
1703
1703
|
files: [`**/*.config*.${GLOB_SRC_EXT}`],
|
|
1704
1704
|
plugins: {
|
|
1705
|
-
import:
|
|
1705
|
+
"import-x": default15,
|
|
1706
1706
|
perfectionist: default19
|
|
1707
1707
|
},
|
|
1708
1708
|
rules: {
|
|
1709
1709
|
"no-console": "off",
|
|
1710
|
-
"import/no-default-export": "off",
|
|
1710
|
+
"import-x/no-default-export": "off",
|
|
1711
1711
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1712
1712
|
"perfectionist/sort-objects": [
|
|
1713
1713
|
"error",
|
|
@@ -1789,7 +1789,7 @@ var markdown = (options = {}) => {
|
|
|
1789
1789
|
"no-restricted-imports": "off",
|
|
1790
1790
|
"node/prefer-global/buffer": "off",
|
|
1791
1791
|
"node/prefer-global/process": "off",
|
|
1792
|
-
"import/no-unresolved": "off",
|
|
1792
|
+
"import-x/no-unresolved": "off",
|
|
1793
1793
|
"unused-imports/no-unused-imports": "off",
|
|
1794
1794
|
"unused-imports/no-unused-vars": "off",
|
|
1795
1795
|
"@typescript-eslint/comma-dangle": "off",
|
|
@@ -2332,8 +2332,8 @@ var typescript = (options = {}) => {
|
|
|
2332
2332
|
rules: {
|
|
2333
2333
|
"no-use-before-define": "off",
|
|
2334
2334
|
"no-restricted-syntax": "off",
|
|
2335
|
-
"import/no-duplicates": "off",
|
|
2336
|
-
"import/newline-after-import": "off",
|
|
2335
|
+
"import-x/no-duplicates": "off",
|
|
2336
|
+
"import-x/newline-after-import": "off",
|
|
2337
2337
|
"@typescript-eslint/no-use-before-define": "off"
|
|
2338
2338
|
}
|
|
2339
2339
|
}
|
|
@@ -2367,6 +2367,71 @@ var githubAction = (options = {}) => {
|
|
|
2367
2367
|
};
|
|
2368
2368
|
|
|
2369
2369
|
// src/configs/perfectionist.ts
|
|
2370
|
+
var sharedGroups = [
|
|
2371
|
+
"required-property",
|
|
2372
|
+
"optional-property",
|
|
2373
|
+
"required-method",
|
|
2374
|
+
"optional-method",
|
|
2375
|
+
"required-multiline-property",
|
|
2376
|
+
"optional-multiline-property",
|
|
2377
|
+
"required-multiline-method",
|
|
2378
|
+
"optional-multiline-method",
|
|
2379
|
+
"unknown",
|
|
2380
|
+
"index-signature",
|
|
2381
|
+
"multiline-index-signature"
|
|
2382
|
+
];
|
|
2383
|
+
var defaultSortInterfacesGroups = [...sharedGroups];
|
|
2384
|
+
var defaultSortObjectTypesGroups = [...sharedGroups];
|
|
2385
|
+
var defaultSortIntersectionTypesGroups = [
|
|
2386
|
+
/**
|
|
2387
|
+
* eg. 'foobar', 24, false
|
|
2388
|
+
*/
|
|
2389
|
+
"literal",
|
|
2390
|
+
/**
|
|
2391
|
+
* eg. number, string
|
|
2392
|
+
*/
|
|
2393
|
+
"keyword",
|
|
2394
|
+
/**
|
|
2395
|
+
* eg. FooBar
|
|
2396
|
+
*/
|
|
2397
|
+
"named",
|
|
2398
|
+
/**
|
|
2399
|
+
* eg. Foo & Bar
|
|
2400
|
+
*/
|
|
2401
|
+
"intersection",
|
|
2402
|
+
/**
|
|
2403
|
+
* eg. Foobar extends string ? Foo : Bar
|
|
2404
|
+
*/
|
|
2405
|
+
"conditional",
|
|
2406
|
+
/**
|
|
2407
|
+
* eg. (...args: any[]) => void
|
|
2408
|
+
*/
|
|
2409
|
+
"function",
|
|
2410
|
+
/**
|
|
2411
|
+
* eg. import('eslint').Linter
|
|
2412
|
+
*/
|
|
2413
|
+
"import",
|
|
2414
|
+
/**
|
|
2415
|
+
* eg. { foo: string; bar: number; }
|
|
2416
|
+
*/
|
|
2417
|
+
"object",
|
|
2418
|
+
/**
|
|
2419
|
+
* eg. keyof T
|
|
2420
|
+
*/
|
|
2421
|
+
"operator",
|
|
2422
|
+
/**
|
|
2423
|
+
* eg. [string, number]
|
|
2424
|
+
*/
|
|
2425
|
+
"tuple",
|
|
2426
|
+
/**
|
|
2427
|
+
* eg. Foo | Bar
|
|
2428
|
+
*/
|
|
2429
|
+
"union",
|
|
2430
|
+
/**
|
|
2431
|
+
* eg. null | undefined
|
|
2432
|
+
*/
|
|
2433
|
+
"nullish"
|
|
2434
|
+
];
|
|
2370
2435
|
var perfectionist = (options = {}) => {
|
|
2371
2436
|
const {
|
|
2372
2437
|
sortEnums: enableSortEnums = true,
|
|
@@ -2501,34 +2566,22 @@ var perfectionist = (options = {}) => {
|
|
|
2501
2566
|
order: "asc"
|
|
2502
2567
|
}
|
|
2503
2568
|
],
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2569
|
+
"perfectionist/sort-interfaces": [
|
|
2570
|
+
"error",
|
|
2571
|
+
{
|
|
2572
|
+
type: "alphabetical",
|
|
2573
|
+
order: "asc",
|
|
2574
|
+
partitionByComment: true,
|
|
2575
|
+
groups: defaultSortInterfacesGroups
|
|
2576
|
+
}
|
|
2577
|
+
],
|
|
2512
2578
|
"perfectionist/sort-intersection-types": [
|
|
2513
2579
|
"error",
|
|
2514
2580
|
{
|
|
2515
2581
|
type: "alphabetical",
|
|
2516
2582
|
order: "asc",
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
"named",
|
|
2520
|
-
"conditional",
|
|
2521
|
-
"function",
|
|
2522
|
-
"import",
|
|
2523
|
-
"keyword",
|
|
2524
|
-
"literal",
|
|
2525
|
-
"object",
|
|
2526
|
-
"operator",
|
|
2527
|
-
"tuple",
|
|
2528
|
-
"union",
|
|
2529
|
-
"nullish"
|
|
2530
|
-
],
|
|
2531
|
-
partitionByComment: true
|
|
2583
|
+
partitionByComment: true,
|
|
2584
|
+
groups: [...defaultSortIntersectionTypesGroups]
|
|
2532
2585
|
}
|
|
2533
2586
|
],
|
|
2534
2587
|
"perfectionist/sort-modules": [
|
|
@@ -2544,7 +2597,8 @@ var perfectionist = (options = {}) => {
|
|
|
2544
2597
|
{
|
|
2545
2598
|
type: "alphabetical",
|
|
2546
2599
|
order: "asc",
|
|
2547
|
-
partitionByComment: true
|
|
2600
|
+
partitionByComment: true,
|
|
2601
|
+
groups: []
|
|
2548
2602
|
}
|
|
2549
2603
|
],
|
|
2550
2604
|
"perfectionist/sort-union-types": [
|
|
@@ -2688,8 +2742,8 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2688
2742
|
...command({
|
|
2689
2743
|
...resolveSubOptions(options, "command")
|
|
2690
2744
|
}),
|
|
2691
|
-
...
|
|
2692
|
-
overrides: getOverrides(options, "
|
|
2745
|
+
...importX({
|
|
2746
|
+
overrides: getOverrides(options, "importX")
|
|
2693
2747
|
}),
|
|
2694
2748
|
...jsdoc({
|
|
2695
2749
|
typescript: !!enableTypeScript,
|
|
@@ -2871,6 +2925,9 @@ export {
|
|
|
2871
2925
|
antfu,
|
|
2872
2926
|
command,
|
|
2873
2927
|
comments,
|
|
2928
|
+
defaultSortInterfacesGroups,
|
|
2929
|
+
defaultSortIntersectionTypesGroups,
|
|
2930
|
+
defaultSortObjectTypesGroups,
|
|
2874
2931
|
defineESLintConfig,
|
|
2875
2932
|
format,
|
|
2876
2933
|
getOverrides,
|
|
@@ -2881,7 +2938,7 @@ export {
|
|
|
2881
2938
|
hasVitest,
|
|
2882
2939
|
hasVue,
|
|
2883
2940
|
ignores,
|
|
2884
|
-
|
|
2941
|
+
importX,
|
|
2885
2942
|
interopDefault,
|
|
2886
2943
|
javascript,
|
|
2887
2944
|
jsdoc,
|
|
@@ -2904,7 +2961,7 @@ export {
|
|
|
2904
2961
|
default21 as pluginComments,
|
|
2905
2962
|
default11 as pluginFormat,
|
|
2906
2963
|
default18 as pluginGitHubAction,
|
|
2907
|
-
|
|
2964
|
+
default15 as pluginImportX,
|
|
2908
2965
|
default9 as pluginJsdoc,
|
|
2909
2966
|
default10 as pluginJsonc,
|
|
2910
2967
|
default7 as pluginMarkdown,
|
|
@@ -2916,7 +2973,7 @@ export {
|
|
|
2916
2973
|
default17 as pluginStylistic,
|
|
2917
2974
|
default5 as pluginToml,
|
|
2918
2975
|
plugin as pluginTypeScript,
|
|
2919
|
-
|
|
2976
|
+
default14 as pluginUnicorn,
|
|
2920
2977
|
default12 as pluginUnoCSS,
|
|
2921
2978
|
default20 as pluginUnusedImports,
|
|
2922
2979
|
default13 as pluginVitest,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.8.0",
|
|
5
5
|
"packageManager": "pnpm@9.14.4",
|
|
6
6
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
7
7
|
"keywords": [
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@eslint/markdown": "^6.2.1",
|
|
62
62
|
"@stylistic/eslint-plugin": "^2.11.0",
|
|
63
63
|
"@unocss/eslint-plugin": "^0.65.0",
|
|
64
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
64
|
+
"@vitest/eslint-plugin": "^1.1.14",
|
|
65
65
|
"eslint-config-flat-gitignore": "^0.3.0",
|
|
66
66
|
"eslint-flat-config-utils": "^0.4.0",
|
|
67
67
|
"eslint-merge-processors": "^0.1.0",
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
"eslint-plugin-command": "^0.2.6",
|
|
70
70
|
"eslint-plugin-format": "^0.1.3",
|
|
71
71
|
"eslint-plugin-github-action": "^0.0.8",
|
|
72
|
-
"eslint-plugin-import-x": "^4.
|
|
72
|
+
"eslint-plugin-import-x": "^4.5.0",
|
|
73
73
|
"eslint-plugin-jsdoc": "^50.6.0",
|
|
74
74
|
"eslint-plugin-jsonc": "^2.18.2",
|
|
75
75
|
"eslint-plugin-n": "^17.14.0",
|
|
76
76
|
"eslint-plugin-ntnyq": "^0.7.1",
|
|
77
|
-
"eslint-plugin-perfectionist": "^4.
|
|
77
|
+
"eslint-plugin-perfectionist": "^4.2.0",
|
|
78
78
|
"eslint-plugin-prettier": "^5.2.1",
|
|
79
79
|
"eslint-plugin-regexp": "^2.7.0",
|
|
80
80
|
"eslint-plugin-toml": "^0.12.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"local-pkg": "^0.5.1",
|
|
89
89
|
"prettier": "^3.4.1",
|
|
90
90
|
"toml-eslint-parser": "^0.10.0",
|
|
91
|
-
"typescript-eslint": "^8.
|
|
91
|
+
"typescript-eslint": "^8.17.0",
|
|
92
92
|
"vue-eslint-parser": "^9.4.3",
|
|
93
93
|
"yaml-eslint-parser": "^1.2.3"
|
|
94
94
|
},
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"tsup": "^8.3.5",
|
|
107
107
|
"tsx": "^4.19.2",
|
|
108
108
|
"typescript": "^5.7.2",
|
|
109
|
-
"vitest": "^2.1.
|
|
109
|
+
"vitest": "^2.1.8",
|
|
110
110
|
"zx": "^8.2.4"
|
|
111
111
|
},
|
|
112
112
|
"engines": {
|