@ntnyq/eslint-config 3.7.2 → 3.8.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/README.md +1 -1
- package/dist/index.cjs +130 -54
- package/dist/index.d.cts +6279 -4008
- package/dist/index.d.ts +6279 -4008
- package/dist/index.js +190 -116
- package/package.json +7 -6
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -68,6 +68,7 @@ __export(src_exports, {
|
|
|
68
68
|
command: () => command,
|
|
69
69
|
comments: () => comments,
|
|
70
70
|
defineESLintConfig: () => defineESLintConfig,
|
|
71
|
+
esX: () => esX,
|
|
71
72
|
format: () => format,
|
|
72
73
|
getOverrides: () => getOverrides,
|
|
73
74
|
githubAction: () => githubAction,
|
|
@@ -77,7 +78,7 @@ __export(src_exports, {
|
|
|
77
78
|
hasVitest: () => hasVitest,
|
|
78
79
|
hasVue: () => hasVue,
|
|
79
80
|
ignores: () => ignores,
|
|
80
|
-
|
|
81
|
+
importX: () => importX,
|
|
81
82
|
interopDefault: () => interopDefault,
|
|
82
83
|
javascript: () => javascript,
|
|
83
84
|
jsdoc: () => jsdoc,
|
|
@@ -98,9 +99,10 @@ __export(src_exports, {
|
|
|
98
99
|
perfectionist: () => perfectionist,
|
|
99
100
|
pluginAntfu: () => import_eslint_plugin_antfu.default,
|
|
100
101
|
pluginComments: () => import_eslint_plugin_eslint_comments.default,
|
|
102
|
+
pluginEsX: () => import_eslint_plugin_es_x.default,
|
|
101
103
|
pluginFormat: () => import_eslint_plugin_format.default,
|
|
102
104
|
pluginGitHubAction: () => import_eslint_plugin_github_action.default,
|
|
103
|
-
|
|
105
|
+
pluginImportX: () => import_eslint_plugin_import_x.default,
|
|
104
106
|
pluginJsdoc: () => import_eslint_plugin_jsdoc.default,
|
|
105
107
|
pluginJsonc: () => import_eslint_plugin_jsonc.default,
|
|
106
108
|
pluginMarkdown: () => import_markdown.default,
|
|
@@ -178,6 +180,7 @@ var parserPlain = {
|
|
|
178
180
|
var pluginRegexp = __toESM(require("eslint-plugin-regexp"), 1);
|
|
179
181
|
var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
|
|
180
182
|
var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1);
|
|
183
|
+
var import_eslint_plugin_es_x = __toESM(require("eslint-plugin-es-x"), 1);
|
|
181
184
|
var import_eslint_plugin_yml = __toESM(require("eslint-plugin-yml"), 1);
|
|
182
185
|
var import_eslint_plugin_toml = __toESM(require("eslint-plugin-toml"), 1);
|
|
183
186
|
var import_eslint_plugin_ntnyq = __toESM(require("eslint-plugin-ntnyq"), 1);
|
|
@@ -189,8 +192,8 @@ var import_typescript_eslint2 = require("typescript-eslint");
|
|
|
189
192
|
var import_eslint_plugin_format = __toESM(require("eslint-plugin-format"), 1);
|
|
190
193
|
var import_eslint_plugin = __toESM(require("@unocss/eslint-plugin"), 1);
|
|
191
194
|
var import_eslint_plugin2 = __toESM(require("@vitest/eslint-plugin"), 1);
|
|
192
|
-
var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
|
|
193
195
|
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
196
|
+
var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
|
|
194
197
|
var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
|
|
195
198
|
var import_eslint_plugin3 = __toESM(require("@stylistic/eslint-plugin"), 1);
|
|
196
199
|
var import_eslint_plugin_github_action = __toESM(require("eslint-plugin-github-action"), 1);
|
|
@@ -402,7 +405,7 @@ var unCategorizedRules = {
|
|
|
402
405
|
"vue/next-tick-style": ["error", "promise"],
|
|
403
406
|
"vue/v-for-delimiter-style": ["error", "in"],
|
|
404
407
|
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
405
|
-
"vue/slot-name-casing": ["error", "
|
|
408
|
+
"vue/slot-name-casing": ["error", "kebab-case"],
|
|
406
409
|
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
407
410
|
"vue/define-props-declaration": ["error", "type-based"],
|
|
408
411
|
"vue/define-emits-declaration": ["error", "type-literal"],
|
|
@@ -681,6 +684,20 @@ var yml = (options = {}) => [
|
|
|
681
684
|
}
|
|
682
685
|
];
|
|
683
686
|
|
|
687
|
+
// src/configs/esX.ts
|
|
688
|
+
var esX = (options = {}) => [
|
|
689
|
+
{
|
|
690
|
+
name: "ntnyq/es-x",
|
|
691
|
+
plugins: {
|
|
692
|
+
"es-x": import_eslint_plugin_es_x.default
|
|
693
|
+
},
|
|
694
|
+
rules: {
|
|
695
|
+
// Overrides rules
|
|
696
|
+
...options.overrides
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
];
|
|
700
|
+
|
|
684
701
|
// src/configs/node.ts
|
|
685
702
|
var node = (options = {}) => [
|
|
686
703
|
{
|
|
@@ -1676,31 +1693,31 @@ var ignores = (customIgnores = []) => [
|
|
|
1676
1693
|
}
|
|
1677
1694
|
];
|
|
1678
1695
|
|
|
1679
|
-
// src/configs/
|
|
1680
|
-
var
|
|
1696
|
+
// src/configs/importX.ts
|
|
1697
|
+
var importX = (options = {}) => [
|
|
1681
1698
|
{
|
|
1682
|
-
name: "ntnyq/
|
|
1699
|
+
name: "ntnyq/import-x",
|
|
1683
1700
|
plugins: {
|
|
1684
|
-
import: import_eslint_plugin_import_x.default
|
|
1701
|
+
"import-x": import_eslint_plugin_import_x.default
|
|
1685
1702
|
},
|
|
1686
1703
|
settings: {
|
|
1687
|
-
"import/resolver": {
|
|
1704
|
+
"import-x/resolver": {
|
|
1688
1705
|
node: { extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts"] }
|
|
1689
1706
|
}
|
|
1690
1707
|
},
|
|
1691
1708
|
rules: {
|
|
1692
|
-
"import/no-unresolved": "off",
|
|
1693
|
-
"import/no-absolute-path": "off",
|
|
1694
|
-
"import/no-named-as-default-member": "off",
|
|
1695
|
-
"import/no-named-default": "off",
|
|
1709
|
+
"import-x/no-unresolved": "off",
|
|
1710
|
+
"import-x/no-absolute-path": "off",
|
|
1711
|
+
"import-x/no-named-as-default-member": "off",
|
|
1712
|
+
"import-x/no-named-default": "off",
|
|
1696
1713
|
// disabled in favor or `perfectionist/sort-imports`
|
|
1697
|
-
"import/order": "off",
|
|
1698
|
-
"import/first": "error",
|
|
1699
|
-
"import/export": "error",
|
|
1700
|
-
"import/no-self-import": "error",
|
|
1701
|
-
"import/no-duplicates": "error",
|
|
1702
|
-
"import/no-mutable-exports": "error",
|
|
1703
|
-
"import/newline-after-import": "error",
|
|
1714
|
+
"import-x/order": "off",
|
|
1715
|
+
"import-x/first": "error",
|
|
1716
|
+
"import-x/export": "error",
|
|
1717
|
+
"import-x/no-self-import": "error",
|
|
1718
|
+
"import-x/no-duplicates": "error",
|
|
1719
|
+
"import-x/no-mutable-exports": "error",
|
|
1720
|
+
"import-x/newline-after-import": "error",
|
|
1704
1721
|
// Overrides rules
|
|
1705
1722
|
...options.overrides
|
|
1706
1723
|
}
|
|
@@ -1844,12 +1861,12 @@ var specials = (options = {}) => [
|
|
|
1844
1861
|
name: "ntnyq/specials/config-file",
|
|
1845
1862
|
files: [`**/*.config*.${GLOB_SRC_EXT}`],
|
|
1846
1863
|
plugins: {
|
|
1847
|
-
import: import_eslint_plugin_import_x.default,
|
|
1864
|
+
"import-x": import_eslint_plugin_import_x.default,
|
|
1848
1865
|
perfectionist: import_eslint_plugin_perfectionist.default
|
|
1849
1866
|
},
|
|
1850
1867
|
rules: {
|
|
1851
1868
|
"no-console": "off",
|
|
1852
|
-
"import/no-default-export": "off",
|
|
1869
|
+
"import-x/no-default-export": "off",
|
|
1853
1870
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1854
1871
|
"perfectionist/sort-objects": [
|
|
1855
1872
|
"error",
|
|
@@ -1931,7 +1948,7 @@ var markdown = (options = {}) => {
|
|
|
1931
1948
|
"no-restricted-imports": "off",
|
|
1932
1949
|
"node/prefer-global/buffer": "off",
|
|
1933
1950
|
"node/prefer-global/process": "off",
|
|
1934
|
-
"import/no-unresolved": "off",
|
|
1951
|
+
"import-x/no-unresolved": "off",
|
|
1935
1952
|
"unused-imports/no-unused-imports": "off",
|
|
1936
1953
|
"unused-imports/no-unused-vars": "off",
|
|
1937
1954
|
"@typescript-eslint/comma-dangle": "off",
|
|
@@ -2474,8 +2491,8 @@ var typescript = (options = {}) => {
|
|
|
2474
2491
|
rules: {
|
|
2475
2492
|
"no-use-before-define": "off",
|
|
2476
2493
|
"no-restricted-syntax": "off",
|
|
2477
|
-
"import/no-duplicates": "off",
|
|
2478
|
-
"import/newline-after-import": "off",
|
|
2494
|
+
"import-x/no-duplicates": "off",
|
|
2495
|
+
"import-x/newline-after-import": "off",
|
|
2479
2496
|
"@typescript-eslint/no-use-before-define": "off"
|
|
2480
2497
|
}
|
|
2481
2498
|
}
|
|
@@ -2509,6 +2526,73 @@ var githubAction = (options = {}) => {
|
|
|
2509
2526
|
};
|
|
2510
2527
|
|
|
2511
2528
|
// src/configs/perfectionist.ts
|
|
2529
|
+
var sharedGroupsForInterfaceOrObjectTypes = [
|
|
2530
|
+
"required-property",
|
|
2531
|
+
"optional-property",
|
|
2532
|
+
"required-method",
|
|
2533
|
+
"optional-method",
|
|
2534
|
+
"required-multiline-property",
|
|
2535
|
+
"optional-multiline-property",
|
|
2536
|
+
"required-multiline-method",
|
|
2537
|
+
"optional-multiline-method",
|
|
2538
|
+
"unknown",
|
|
2539
|
+
"index-signature",
|
|
2540
|
+
"multiline-index-signature"
|
|
2541
|
+
];
|
|
2542
|
+
var sharedGroupsForIntersectionOrUnion = [
|
|
2543
|
+
/**
|
|
2544
|
+
* eg. 'foobar', 24, false
|
|
2545
|
+
*/
|
|
2546
|
+
"literal",
|
|
2547
|
+
/**
|
|
2548
|
+
* eg. number, string
|
|
2549
|
+
*/
|
|
2550
|
+
"keyword",
|
|
2551
|
+
/**
|
|
2552
|
+
* eg. FooBar
|
|
2553
|
+
*/
|
|
2554
|
+
"named",
|
|
2555
|
+
/**
|
|
2556
|
+
* eg. Foo & Bar
|
|
2557
|
+
*/
|
|
2558
|
+
"intersection",
|
|
2559
|
+
/**
|
|
2560
|
+
* eg. Foobar extends string ? Foo : Bar
|
|
2561
|
+
*/
|
|
2562
|
+
"conditional",
|
|
2563
|
+
/**
|
|
2564
|
+
* eg. (...args: any[]) => void
|
|
2565
|
+
*/
|
|
2566
|
+
"function",
|
|
2567
|
+
/**
|
|
2568
|
+
* eg. import('eslint').Linter
|
|
2569
|
+
*/
|
|
2570
|
+
"import",
|
|
2571
|
+
/**
|
|
2572
|
+
* eg. { foo: string; bar: number; }
|
|
2573
|
+
*/
|
|
2574
|
+
"object",
|
|
2575
|
+
/**
|
|
2576
|
+
* eg. keyof T
|
|
2577
|
+
*/
|
|
2578
|
+
"operator",
|
|
2579
|
+
/**
|
|
2580
|
+
* eg. [string, number]
|
|
2581
|
+
*/
|
|
2582
|
+
"tuple",
|
|
2583
|
+
/**
|
|
2584
|
+
* eg. Foo | Bar
|
|
2585
|
+
*/
|
|
2586
|
+
"union",
|
|
2587
|
+
/**
|
|
2588
|
+
* eg. null | undefined
|
|
2589
|
+
*/
|
|
2590
|
+
"nullish"
|
|
2591
|
+
];
|
|
2592
|
+
var defaultSortInterfacesGroups = [...sharedGroupsForInterfaceOrObjectTypes];
|
|
2593
|
+
var defaultSortObjectTypesGroups = [...sharedGroupsForInterfaceOrObjectTypes];
|
|
2594
|
+
var defaultSortIntersectionTypesGroups = [...sharedGroupsForIntersectionOrUnion];
|
|
2595
|
+
var defaultSortUnionTypesGroups = [...sharedGroupsForIntersectionOrUnion];
|
|
2512
2596
|
var perfectionist = (options = {}) => {
|
|
2513
2597
|
const {
|
|
2514
2598
|
sortEnums: enableSortEnums = true,
|
|
@@ -2643,34 +2727,22 @@ var perfectionist = (options = {}) => {
|
|
|
2643
2727
|
order: "asc"
|
|
2644
2728
|
}
|
|
2645
2729
|
],
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2730
|
+
"perfectionist/sort-interfaces": [
|
|
2731
|
+
"error",
|
|
2732
|
+
{
|
|
2733
|
+
type: "alphabetical",
|
|
2734
|
+
order: "asc",
|
|
2735
|
+
partitionByComment: true,
|
|
2736
|
+
groups: defaultSortInterfacesGroups
|
|
2737
|
+
}
|
|
2738
|
+
],
|
|
2654
2739
|
"perfectionist/sort-intersection-types": [
|
|
2655
2740
|
"error",
|
|
2656
2741
|
{
|
|
2657
2742
|
type: "alphabetical",
|
|
2658
2743
|
order: "asc",
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
"named",
|
|
2662
|
-
"conditional",
|
|
2663
|
-
"function",
|
|
2664
|
-
"import",
|
|
2665
|
-
"keyword",
|
|
2666
|
-
"literal",
|
|
2667
|
-
"object",
|
|
2668
|
-
"operator",
|
|
2669
|
-
"tuple",
|
|
2670
|
-
"union",
|
|
2671
|
-
"nullish"
|
|
2672
|
-
],
|
|
2673
|
-
partitionByComment: true
|
|
2744
|
+
partitionByComment: true,
|
|
2745
|
+
groups: defaultSortIntersectionTypesGroups
|
|
2674
2746
|
}
|
|
2675
2747
|
],
|
|
2676
2748
|
"perfectionist/sort-modules": [
|
|
@@ -2686,7 +2758,8 @@ var perfectionist = (options = {}) => {
|
|
|
2686
2758
|
{
|
|
2687
2759
|
type: "alphabetical",
|
|
2688
2760
|
order: "asc",
|
|
2689
|
-
partitionByComment: true
|
|
2761
|
+
partitionByComment: true,
|
|
2762
|
+
groups: defaultSortObjectTypesGroups
|
|
2690
2763
|
}
|
|
2691
2764
|
],
|
|
2692
2765
|
"perfectionist/sort-union-types": [
|
|
@@ -2694,7 +2767,8 @@ var perfectionist = (options = {}) => {
|
|
|
2694
2767
|
{
|
|
2695
2768
|
type: "alphabetical",
|
|
2696
2769
|
order: "asc",
|
|
2697
|
-
partitionByComment: true
|
|
2770
|
+
partitionByComment: true,
|
|
2771
|
+
groups: defaultSortUnionTypesGroups
|
|
2698
2772
|
}
|
|
2699
2773
|
],
|
|
2700
2774
|
// Overrides rules
|
|
@@ -2830,8 +2904,8 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2830
2904
|
...command({
|
|
2831
2905
|
...resolveSubOptions(options, "command")
|
|
2832
2906
|
}),
|
|
2833
|
-
...
|
|
2834
|
-
overrides: getOverrides(options, "
|
|
2907
|
+
...importX({
|
|
2908
|
+
overrides: getOverrides(options, "importX")
|
|
2835
2909
|
}),
|
|
2836
2910
|
...jsdoc({
|
|
2837
2911
|
typescript: !!enableTypeScript,
|
|
@@ -3015,6 +3089,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3015
3089
|
command,
|
|
3016
3090
|
comments,
|
|
3017
3091
|
defineESLintConfig,
|
|
3092
|
+
esX,
|
|
3018
3093
|
format,
|
|
3019
3094
|
getOverrides,
|
|
3020
3095
|
githubAction,
|
|
@@ -3024,7 +3099,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3024
3099
|
hasVitest,
|
|
3025
3100
|
hasVue,
|
|
3026
3101
|
ignores,
|
|
3027
|
-
|
|
3102
|
+
importX,
|
|
3028
3103
|
interopDefault,
|
|
3029
3104
|
javascript,
|
|
3030
3105
|
jsdoc,
|
|
@@ -3045,9 +3120,10 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3045
3120
|
perfectionist,
|
|
3046
3121
|
pluginAntfu,
|
|
3047
3122
|
pluginComments,
|
|
3123
|
+
pluginEsX,
|
|
3048
3124
|
pluginFormat,
|
|
3049
3125
|
pluginGitHubAction,
|
|
3050
|
-
|
|
3126
|
+
pluginImportX,
|
|
3051
3127
|
pluginJsdoc,
|
|
3052
3128
|
pluginJsonc,
|
|
3053
3129
|
pluginMarkdown,
|