@ntnyq/eslint-config 5.0.0-beta.3 → 5.0.0-beta.4
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 +27 -8
- package/dist/index.d.ts +49 -49
- package/dist/index.js +13 -11
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -49,9 +49,30 @@ Highly recommended using **`eslint.config.mjs`** as the config file :
|
|
|
49
49
|
|
|
50
50
|
import { defineESLintConfig } from '@ntnyq/eslint-config'
|
|
51
51
|
|
|
52
|
-
export default defineESLintConfig(
|
|
52
|
+
export default defineESLintConfig(
|
|
53
53
|
// Options here
|
|
54
|
-
|
|
54
|
+
{
|
|
55
|
+
// Enable a config
|
|
56
|
+
svgo: true,
|
|
57
|
+
// Disable a config
|
|
58
|
+
jsdoc: false,
|
|
59
|
+
vue: {
|
|
60
|
+
// Overrides built-in rules
|
|
61
|
+
overrides: {
|
|
62
|
+
'vue/slot-name-casing': 'off',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
// Optional user configs here
|
|
67
|
+
[
|
|
68
|
+
{
|
|
69
|
+
files: ['**/utils/*.ts'],
|
|
70
|
+
rules: {
|
|
71
|
+
'antfu/top-level-function': 'error',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
)
|
|
55
76
|
```
|
|
56
77
|
|
|
57
78
|
Add scripts `lint` in `package.json`:
|
|
@@ -94,11 +115,9 @@ bun add prettier @ntnyq/prettier-config -D
|
|
|
94
115
|
// prettier.config.mjs
|
|
95
116
|
// @ts-check
|
|
96
117
|
|
|
97
|
-
import {
|
|
118
|
+
import { defineConfig } from '@ntnyq/prettier-config'
|
|
98
119
|
|
|
99
120
|
export default defineConfig({
|
|
100
|
-
...config,
|
|
101
|
-
|
|
102
121
|
// overrides if needed
|
|
103
122
|
overrides: [
|
|
104
123
|
{
|
|
@@ -204,11 +223,8 @@ export interface ConfigOptions {
|
|
|
204
223
|
command?: ConfigCommandOptions
|
|
205
224
|
eslintComments?: ConfigESLintCommentsOptions
|
|
206
225
|
ignores?: ConfigIgnoresOptions
|
|
207
|
-
importX?: ConfigImportXOptions
|
|
208
226
|
javascript?: ConfigJavaScriptOptions
|
|
209
|
-
jsdoc?: ConfigJsdocOptions
|
|
210
227
|
node?: ConfigNodeOptions
|
|
211
|
-
specials?: ConfigSpecialsOptions
|
|
212
228
|
|
|
213
229
|
/**
|
|
214
230
|
* Configs bellow can be disabled
|
|
@@ -218,6 +234,8 @@ export interface ConfigOptions {
|
|
|
218
234
|
depend?: boolean | ConfigDependOptions
|
|
219
235
|
githubAction?: boolean | ConfigGitHubActionOptions
|
|
220
236
|
gitignore?: boolean | ConfigGitIgnoreOptions
|
|
237
|
+
importX?: boolean | ConfigImportXOptions
|
|
238
|
+
jsdoc?: boolean | ConfigJsdocOptions
|
|
221
239
|
jsonc?: boolean | ConfigJsoncOptions
|
|
222
240
|
markdown?: boolean | ConfigMarkdownOptions
|
|
223
241
|
ntnyq?: boolean | ConfigNtnyqOptions
|
|
@@ -226,6 +244,7 @@ export interface ConfigOptions {
|
|
|
226
244
|
prettier?: boolean | ConfigPrettierOptions
|
|
227
245
|
regexp?: boolean | ConfigRegexpOptions
|
|
228
246
|
sort?: boolean | ConfigSortOptions
|
|
247
|
+
specials?: boolean | ConfigSpecialsOptions
|
|
229
248
|
test?: boolean | ConfigTestOptions
|
|
230
249
|
toml?: boolean | ConfigTomlOptions
|
|
231
250
|
typescript?: boolean | ConfigTypeScriptOptions
|
package/dist/index.d.ts
CHANGED
|
@@ -2647,233 +2647,233 @@ interface RuleOptions {
|
|
|
2647
2647
|
'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>;
|
|
2648
2648
|
/**
|
|
2649
2649
|
* Enforce or ban the use of inline type-only markers for named imports.
|
|
2650
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2650
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/consistent-type-specifier-style.md
|
|
2651
2651
|
*/
|
|
2652
2652
|
'import-x/consistent-type-specifier-style'?: Linter.RuleEntry<ImportXConsistentTypeSpecifierStyle>;
|
|
2653
2653
|
/**
|
|
2654
2654
|
* Ensure a default export is present, given a default import.
|
|
2655
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2655
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/default.md
|
|
2656
2656
|
*/
|
|
2657
2657
|
'import-x/default'?: Linter.RuleEntry<[]>;
|
|
2658
2658
|
/**
|
|
2659
2659
|
* Enforce a leading comment with the webpackChunkName for dynamic imports.
|
|
2660
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2660
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/dynamic-import-chunkname.md
|
|
2661
2661
|
*/
|
|
2662
2662
|
'import-x/dynamic-import-chunkname'?: Linter.RuleEntry<ImportXDynamicImportChunkname>;
|
|
2663
2663
|
/**
|
|
2664
2664
|
* Forbid any invalid exports, i.e. re-export of the same name.
|
|
2665
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2665
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/export.md
|
|
2666
2666
|
*/
|
|
2667
2667
|
'import-x/export'?: Linter.RuleEntry<[]>;
|
|
2668
2668
|
/**
|
|
2669
2669
|
* Ensure all exports appear after other statements.
|
|
2670
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2670
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/exports-last.md
|
|
2671
2671
|
*/
|
|
2672
2672
|
'import-x/exports-last'?: Linter.RuleEntry<[]>;
|
|
2673
2673
|
/**
|
|
2674
2674
|
* Ensure consistent use of file extension within the import path.
|
|
2675
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2675
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/extensions.md
|
|
2676
2676
|
*/
|
|
2677
2677
|
'import-x/extensions'?: Linter.RuleEntry<ImportXExtensions>;
|
|
2678
2678
|
/**
|
|
2679
2679
|
* Ensure all imports appear before other statements.
|
|
2680
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2680
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/first.md
|
|
2681
2681
|
*/
|
|
2682
2682
|
'import-x/first'?: Linter.RuleEntry<ImportXFirst>;
|
|
2683
2683
|
/**
|
|
2684
2684
|
* Prefer named exports to be grouped together in a single export declaration.
|
|
2685
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2685
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/group-exports.md
|
|
2686
2686
|
*/
|
|
2687
2687
|
'import-x/group-exports'?: Linter.RuleEntry<[]>;
|
|
2688
2688
|
/**
|
|
2689
2689
|
* Replaced by `import-x/first`.
|
|
2690
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2690
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/imports-first.md
|
|
2691
2691
|
* @deprecated
|
|
2692
2692
|
*/
|
|
2693
2693
|
'import-x/imports-first'?: Linter.RuleEntry<ImportXImportsFirst>;
|
|
2694
2694
|
/**
|
|
2695
2695
|
* Enforce the maximum number of dependencies a module can have.
|
|
2696
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2696
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/max-dependencies.md
|
|
2697
2697
|
*/
|
|
2698
2698
|
'import-x/max-dependencies'?: Linter.RuleEntry<ImportXMaxDependencies>;
|
|
2699
2699
|
/**
|
|
2700
2700
|
* Ensure named imports correspond to a named export in the remote file.
|
|
2701
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2701
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/named.md
|
|
2702
2702
|
*/
|
|
2703
2703
|
'import-x/named'?: Linter.RuleEntry<ImportXNamed>;
|
|
2704
2704
|
/**
|
|
2705
2705
|
* Ensure imported namespaces contain dereferenced properties as they are dereferenced.
|
|
2706
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2706
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/namespace.md
|
|
2707
2707
|
*/
|
|
2708
2708
|
'import-x/namespace'?: Linter.RuleEntry<ImportXNamespace>;
|
|
2709
2709
|
/**
|
|
2710
2710
|
* Enforce a newline after import statements.
|
|
2711
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2711
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/newline-after-import.md
|
|
2712
2712
|
*/
|
|
2713
2713
|
'import-x/newline-after-import'?: Linter.RuleEntry<ImportXNewlineAfterImport>;
|
|
2714
2714
|
/**
|
|
2715
2715
|
* Forbid import of modules using absolute paths.
|
|
2716
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2716
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-absolute-path.md
|
|
2717
2717
|
*/
|
|
2718
2718
|
'import-x/no-absolute-path'?: Linter.RuleEntry<ImportXNoAbsolutePath>;
|
|
2719
2719
|
/**
|
|
2720
2720
|
* Forbid AMD `require` and `define` calls.
|
|
2721
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2721
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-amd.md
|
|
2722
2722
|
*/
|
|
2723
2723
|
'import-x/no-amd'?: Linter.RuleEntry<[]>;
|
|
2724
2724
|
/**
|
|
2725
2725
|
* Forbid anonymous values as default exports.
|
|
2726
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2726
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-anonymous-default-export.md
|
|
2727
2727
|
*/
|
|
2728
2728
|
'import-x/no-anonymous-default-export'?: Linter.RuleEntry<ImportXNoAnonymousDefaultExport>;
|
|
2729
2729
|
/**
|
|
2730
2730
|
* Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
|
|
2731
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2731
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-commonjs.md
|
|
2732
2732
|
*/
|
|
2733
2733
|
'import-x/no-commonjs'?: Linter.RuleEntry<ImportXNoCommonjs>;
|
|
2734
2734
|
/**
|
|
2735
2735
|
* Forbid a module from importing a module with a dependency path back to itself.
|
|
2736
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2736
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-cycle.md
|
|
2737
2737
|
*/
|
|
2738
2738
|
'import-x/no-cycle'?: Linter.RuleEntry<ImportXNoCycle>;
|
|
2739
2739
|
/**
|
|
2740
2740
|
* Forbid default exports.
|
|
2741
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2741
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-default-export.md
|
|
2742
2742
|
*/
|
|
2743
2743
|
'import-x/no-default-export'?: Linter.RuleEntry<[]>;
|
|
2744
2744
|
/**
|
|
2745
2745
|
* Forbid imported names marked with `@deprecated` documentation tag.
|
|
2746
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2746
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-deprecated.md
|
|
2747
2747
|
*/
|
|
2748
2748
|
'import-x/no-deprecated'?: Linter.RuleEntry<[]>;
|
|
2749
2749
|
/**
|
|
2750
2750
|
* Forbid repeated import of the same module in multiple places.
|
|
2751
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2751
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-duplicates.md
|
|
2752
2752
|
*/
|
|
2753
2753
|
'import-x/no-duplicates'?: Linter.RuleEntry<ImportXNoDuplicates>;
|
|
2754
2754
|
/**
|
|
2755
2755
|
* Forbid `require()` calls with expressions.
|
|
2756
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2756
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-dynamic-require.md
|
|
2757
2757
|
*/
|
|
2758
2758
|
'import-x/no-dynamic-require'?: Linter.RuleEntry<ImportXNoDynamicRequire>;
|
|
2759
2759
|
/**
|
|
2760
2760
|
* Forbid empty named import blocks.
|
|
2761
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2761
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-empty-named-blocks.md
|
|
2762
2762
|
*/
|
|
2763
2763
|
'import-x/no-empty-named-blocks'?: Linter.RuleEntry<[]>;
|
|
2764
2764
|
/**
|
|
2765
2765
|
* Forbid the use of extraneous packages.
|
|
2766
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2766
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-extraneous-dependencies.md
|
|
2767
2767
|
*/
|
|
2768
2768
|
'import-x/no-extraneous-dependencies'?: Linter.RuleEntry<ImportXNoExtraneousDependencies>;
|
|
2769
2769
|
/**
|
|
2770
2770
|
* Forbid import statements with CommonJS module.exports.
|
|
2771
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2771
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-import-module-exports.md
|
|
2772
2772
|
*/
|
|
2773
2773
|
'import-x/no-import-module-exports'?: Linter.RuleEntry<ImportXNoImportModuleExports>;
|
|
2774
2774
|
/**
|
|
2775
2775
|
* Forbid importing the submodules of other modules.
|
|
2776
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2776
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-internal-modules.md
|
|
2777
2777
|
*/
|
|
2778
2778
|
'import-x/no-internal-modules'?: Linter.RuleEntry<ImportXNoInternalModules>;
|
|
2779
2779
|
/**
|
|
2780
2780
|
* Forbid the use of mutable exports with `var` or `let`.
|
|
2781
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2781
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-mutable-exports.md
|
|
2782
2782
|
*/
|
|
2783
2783
|
'import-x/no-mutable-exports'?: Linter.RuleEntry<[]>;
|
|
2784
2784
|
/**
|
|
2785
2785
|
* Forbid use of exported name as identifier of default export.
|
|
2786
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2786
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-named-as-default.md
|
|
2787
2787
|
*/
|
|
2788
2788
|
'import-x/no-named-as-default'?: Linter.RuleEntry<[]>;
|
|
2789
2789
|
/**
|
|
2790
2790
|
* Forbid use of exported name as property of default export.
|
|
2791
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2791
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-named-as-default-member.md
|
|
2792
2792
|
*/
|
|
2793
2793
|
'import-x/no-named-as-default-member'?: Linter.RuleEntry<[]>;
|
|
2794
2794
|
/**
|
|
2795
2795
|
* Forbid named default exports.
|
|
2796
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2796
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-named-default.md
|
|
2797
2797
|
*/
|
|
2798
2798
|
'import-x/no-named-default'?: Linter.RuleEntry<[]>;
|
|
2799
2799
|
/**
|
|
2800
2800
|
* Forbid named exports.
|
|
2801
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2801
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-named-export.md
|
|
2802
2802
|
*/
|
|
2803
2803
|
'import-x/no-named-export'?: Linter.RuleEntry<[]>;
|
|
2804
2804
|
/**
|
|
2805
2805
|
* Forbid namespace (a.k.a. "wildcard" `*`) imports.
|
|
2806
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2806
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-namespace.md
|
|
2807
2807
|
*/
|
|
2808
2808
|
'import-x/no-namespace'?: Linter.RuleEntry<ImportXNoNamespace>;
|
|
2809
2809
|
/**
|
|
2810
2810
|
* Forbid Node.js builtin modules.
|
|
2811
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2811
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-nodejs-modules.md
|
|
2812
2812
|
*/
|
|
2813
2813
|
'import-x/no-nodejs-modules'?: Linter.RuleEntry<ImportXNoNodejsModules>;
|
|
2814
2814
|
/**
|
|
2815
2815
|
* Forbid importing packages through relative paths.
|
|
2816
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2816
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-relative-packages.md
|
|
2817
2817
|
*/
|
|
2818
2818
|
'import-x/no-relative-packages'?: Linter.RuleEntry<ImportXNoRelativePackages>;
|
|
2819
2819
|
/**
|
|
2820
2820
|
* Forbid importing modules from parent directories.
|
|
2821
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2821
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-relative-parent-imports.md
|
|
2822
2822
|
*/
|
|
2823
2823
|
'import-x/no-relative-parent-imports'?: Linter.RuleEntry<ImportXNoRelativeParentImports>;
|
|
2824
2824
|
/**
|
|
2825
2825
|
* Forbid importing a default export by a different name.
|
|
2826
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2826
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-rename-default.md
|
|
2827
2827
|
*/
|
|
2828
2828
|
'import-x/no-rename-default'?: Linter.RuleEntry<ImportXNoRenameDefault>;
|
|
2829
2829
|
/**
|
|
2830
2830
|
* Enforce which files can be imported in a given folder.
|
|
2831
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2831
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-restricted-paths.md
|
|
2832
2832
|
*/
|
|
2833
2833
|
'import-x/no-restricted-paths'?: Linter.RuleEntry<ImportXNoRestrictedPaths>;
|
|
2834
2834
|
/**
|
|
2835
2835
|
* Forbid a module from importing itself.
|
|
2836
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2836
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-self-import.md
|
|
2837
2837
|
*/
|
|
2838
2838
|
'import-x/no-self-import'?: Linter.RuleEntry<[]>;
|
|
2839
2839
|
/**
|
|
2840
2840
|
* Forbid unassigned imports.
|
|
2841
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2841
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-unassigned-import.md
|
|
2842
2842
|
*/
|
|
2843
2843
|
'import-x/no-unassigned-import'?: Linter.RuleEntry<ImportXNoUnassignedImport>;
|
|
2844
2844
|
/**
|
|
2845
2845
|
* Ensure imports point to a file/module that can be resolved.
|
|
2846
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2846
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-unresolved.md
|
|
2847
2847
|
*/
|
|
2848
2848
|
'import-x/no-unresolved'?: Linter.RuleEntry<ImportXNoUnresolved>;
|
|
2849
2849
|
/**
|
|
2850
2850
|
* Forbid modules without exports, or exports without matching import in another module.
|
|
2851
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2851
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-unused-modules.md
|
|
2852
2852
|
*/
|
|
2853
2853
|
'import-x/no-unused-modules'?: Linter.RuleEntry<ImportXNoUnusedModules>;
|
|
2854
2854
|
/**
|
|
2855
2855
|
* Forbid unnecessary path segments in import and require statements.
|
|
2856
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2856
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-useless-path-segments.md
|
|
2857
2857
|
*/
|
|
2858
2858
|
'import-x/no-useless-path-segments'?: Linter.RuleEntry<ImportXNoUselessPathSegments>;
|
|
2859
2859
|
/**
|
|
2860
2860
|
* Forbid webpack loader syntax in imports.
|
|
2861
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2861
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/no-webpack-loader-syntax.md
|
|
2862
2862
|
*/
|
|
2863
2863
|
'import-x/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>;
|
|
2864
2864
|
/**
|
|
2865
2865
|
* Enforce a convention in module import order.
|
|
2866
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2866
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/order.md
|
|
2867
2867
|
*/
|
|
2868
2868
|
'import-x/order'?: Linter.RuleEntry<ImportXOrder>;
|
|
2869
2869
|
/**
|
|
2870
2870
|
* Prefer a default export if module exports a single name or multiple names.
|
|
2871
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2871
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/prefer-default-export.md
|
|
2872
2872
|
*/
|
|
2873
2873
|
'import-x/prefer-default-export'?: Linter.RuleEntry<ImportXPreferDefaultExport>;
|
|
2874
2874
|
/**
|
|
2875
2875
|
* Forbid potentially ambiguous parse goal (`script` vs. `module`).
|
|
2876
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
2876
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.13.0/docs/rules/unambiguous.md
|
|
2877
2877
|
*/
|
|
2878
2878
|
'import-x/unambiguous'?: Linter.RuleEntry<[]>;
|
|
2879
2879
|
/**
|
|
@@ -16744,11 +16744,8 @@ interface ConfigOptions {
|
|
|
16744
16744
|
command?: ConfigCommandOptions;
|
|
16745
16745
|
eslintComments?: ConfigESLintCommentsOptions;
|
|
16746
16746
|
ignores?: ConfigIgnoresOptions;
|
|
16747
|
-
importX?: ConfigImportXOptions;
|
|
16748
16747
|
javascript?: ConfigJavaScriptOptions;
|
|
16749
|
-
jsdoc?: ConfigJsdocOptions;
|
|
16750
16748
|
node?: ConfigNodeOptions;
|
|
16751
|
-
specials?: ConfigSpecialsOptions;
|
|
16752
16749
|
/**
|
|
16753
16750
|
* Configs bellow can be disabled
|
|
16754
16751
|
* @pg
|
|
@@ -16761,6 +16758,8 @@ interface ConfigOptions {
|
|
|
16761
16758
|
githubAction?: boolean | ConfigGitHubActionOptions;
|
|
16762
16759
|
gitignore?: boolean | ConfigGitIgnoreOptions;
|
|
16763
16760
|
html?: boolean | ConfigHtmlOptions;
|
|
16761
|
+
importX?: boolean | ConfigImportXOptions;
|
|
16762
|
+
jsdoc?: boolean | ConfigJsdocOptions;
|
|
16764
16763
|
jsonc?: boolean | ConfigJsoncOptions;
|
|
16765
16764
|
markdown?: boolean | ConfigMarkdownOptions;
|
|
16766
16765
|
ntnyq?: boolean | ConfigNtnyqOptions;
|
|
@@ -16770,6 +16769,7 @@ interface ConfigOptions {
|
|
|
16770
16769
|
prettier?: boolean | ConfigPrettierOptions;
|
|
16771
16770
|
regexp?: boolean | ConfigRegexpOptions;
|
|
16772
16771
|
sort?: boolean | ConfigSortOptions;
|
|
16772
|
+
specials?: boolean | ConfigSpecialsOptions;
|
|
16773
16773
|
svelte?: boolean | ConfigSvelteOptions;
|
|
16774
16774
|
svgo?: boolean | ConfigSVGOOptions;
|
|
16775
16775
|
test?: boolean | ConfigTestOptions;
|
package/dist/index.js
CHANGED
|
@@ -2430,7 +2430,7 @@ const configJavaScript = (options = {}) => [{
|
|
|
2430
2430
|
properties: "never"
|
|
2431
2431
|
}],
|
|
2432
2432
|
"constructor-super": "error",
|
|
2433
|
-
curly: ["error", "
|
|
2433
|
+
curly: ["error", "all"],
|
|
2434
2434
|
"default-case-last": "error",
|
|
2435
2435
|
"dot-notation": ["error", { allowKeywords: true }],
|
|
2436
2436
|
eqeqeq: ["error", "smart"],
|
|
@@ -3028,25 +3028,27 @@ const configESLintComments = (options = {}) => [{
|
|
|
3028
3028
|
* Config factory
|
|
3029
3029
|
*/
|
|
3030
3030
|
function defineESLintConfig(options = {}, ...userConfigs) {
|
|
3031
|
-
const { shareable = {}, vue: enableVue = hasVue(), pinia: enablePinia = hasPinia(), test: enableTest = hasVitest(), unocss: enableUnoCSS = hasUnoCSS(), typescript: enableTypeScript = hasTypeScript(), yml: enableYML = true, sort: enableSort = true, toml: enableTOML = true, jsonc: enableJSONC = true, antfu: enableAntfu = true, ntnyq: enableNtnyq = true, depend: enableDepend = true, regexp: enableRegexp = true, unicorn: enableUnicorn = true, deMorgan: enableDeMorgan = true, prettier: enablePrettier = true, markdown: enableMarkdown = true, gitignore: enableGitIgnore = true, githubAction: enableGitHubAction = true, perfectionist: enablePerfectionist = true, pnpm: enablePnpm = false, svgo: enableSVGO = false, html: enableHTML = false, astro: enableAstro = false, svelte: enableSvelte = false, eslintPlugin: enableESLintPlugin = false } = options;
|
|
3031
|
+
const { shareable = {}, vue: enableVue = hasVue(), pinia: enablePinia = hasPinia(), test: enableTest = hasVitest(), unocss: enableUnoCSS = hasUnoCSS(), typescript: enableTypeScript = hasTypeScript(), yml: enableYML = true, sort: enableSort = true, toml: enableTOML = true, jsonc: enableJSONC = true, antfu: enableAntfu = true, ntnyq: enableNtnyq = true, depend: enableDepend = true, regexp: enableRegexp = true, unicorn: enableUnicorn = true, deMorgan: enableDeMorgan = true, prettier: enablePrettier = true, markdown: enableMarkdown = true, gitignore: enableGitIgnore = true, jsdoc: enableJsdoc = true, importX: enableImportX = true, specials: enableSpecials = true, githubAction: enableGitHubAction = true, perfectionist: enablePerfectionist = true, pnpm: enablePnpm = false, svgo: enableSVGO = false, html: enableHTML = false, astro: enableAstro = false, svelte: enableSvelte = false, eslintPlugin: enableESLintPlugin = false } = options;
|
|
3032
3032
|
const configs = [];
|
|
3033
3033
|
const { extraFileExtensions = [] } = shareable;
|
|
3034
3034
|
if (enableVue) extraFileExtensions.push(".vue");
|
|
3035
3035
|
if (enableAstro) extraFileExtensions.push(".astro");
|
|
3036
3036
|
if (enableSvelte) extraFileExtensions.push(".svelte");
|
|
3037
3037
|
if (enableGitIgnore) configs.push(configGitIgnore(resolveSubOptions(options, "gitignore")));
|
|
3038
|
-
configs.push(configIgnores(options.ignores), configJSX(), configNode({ overrides: getOverrides(options, "node") }), configCommand(resolveSubOptions(options, "command")),
|
|
3039
|
-
...resolveSubOptions(options, "
|
|
3038
|
+
configs.push(configIgnores(options.ignores), configJSX(), configNode({ overrides: getOverrides(options, "node") }), configCommand(resolveSubOptions(options, "command")), configESLintComments({ overrides: getOverrides(options, "eslintComments") }), configJavaScript({
|
|
3039
|
+
...resolveSubOptions(options, "javascript"),
|
|
3040
|
+
overrides: getOverrides(options, "javascript")
|
|
3041
|
+
}));
|
|
3042
|
+
if (enableImportX) configImportX({
|
|
3040
3043
|
typescript: !!enableTypeScript,
|
|
3044
|
+
...resolveSubOptions(options, "importX"),
|
|
3041
3045
|
overrides: getOverrides(options, "importX")
|
|
3042
|
-
})
|
|
3046
|
+
});
|
|
3047
|
+
if (enableJsdoc) configJsdoc({
|
|
3043
3048
|
typescript: !!enableTypeScript,
|
|
3044
3049
|
overrides: getOverrides(options, "jsdoc"),
|
|
3045
3050
|
...resolveSubOptions(options, "jsdoc")
|
|
3046
|
-
})
|
|
3047
|
-
...resolveSubOptions(options, "javascript"),
|
|
3048
|
-
overrides: getOverrides(options, "javascript")
|
|
3049
|
-
}));
|
|
3051
|
+
});
|
|
3050
3052
|
if (enablePerfectionist) configs.push(configPerfectionist({
|
|
3051
3053
|
...resolveSubOptions(options, "perfectionist"),
|
|
3052
3054
|
overrides: getOverrides(options, "perfectionist")
|
|
@@ -3123,12 +3125,12 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3123
3125
|
...resolveSubOptions(options, "html"),
|
|
3124
3126
|
overrides: getOverrides(options, "html")
|
|
3125
3127
|
}));
|
|
3126
|
-
|
|
3128
|
+
if (enableSpecials) configs.push(configSpecials(resolveSubOptions(options, "specials")));
|
|
3127
3129
|
const prettierConfigs = enablePrettier ? configPrettier({
|
|
3128
3130
|
...resolveSubOptions(options, "prettier"),
|
|
3129
3131
|
overrides: getOverrides(options, "prettier")
|
|
3130
3132
|
}) : [];
|
|
3131
|
-
const composer = new FlatConfigComposer(...configs, ...userConfigs, ...
|
|
3133
|
+
const composer = new FlatConfigComposer(...configs, ...userConfigs, ...prettierConfigs);
|
|
3132
3134
|
return composer;
|
|
3133
3135
|
}
|
|
3134
3136
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.0-beta.
|
|
4
|
+
"version": "5.0.0-beta.4",
|
|
5
5
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"eslint",
|
|
@@ -86,23 +86,23 @@
|
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@antfu/install-pkg": "^1.1.0",
|
|
89
|
-
"@clack/prompts": "^0.
|
|
89
|
+
"@clack/prompts": "^0.11.0",
|
|
90
90
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
91
91
|
"@eslint/js": "^9.27.0",
|
|
92
92
|
"@eslint/markdown": "^6.4.0",
|
|
93
93
|
"@unocss/eslint-plugin": "^66.1.2",
|
|
94
|
-
"@vitest/eslint-plugin": "^1.2.
|
|
94
|
+
"@vitest/eslint-plugin": "^1.2.1",
|
|
95
95
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
96
|
-
"eslint-flat-config-utils": "^2.0
|
|
97
|
-
"eslint-import-resolver-typescript": "^4.
|
|
96
|
+
"eslint-flat-config-utils": "^2.1.0",
|
|
97
|
+
"eslint-import-resolver-typescript": "^4.4.1",
|
|
98
98
|
"eslint-merge-processors": "^2.0.0",
|
|
99
99
|
"eslint-parser-plain": "^0.1.1",
|
|
100
100
|
"eslint-plugin-antfu": "^3.1.1",
|
|
101
|
-
"eslint-plugin-command": "^3.2.
|
|
101
|
+
"eslint-plugin-command": "^3.2.1",
|
|
102
102
|
"eslint-plugin-de-morgan": "^1.2.1",
|
|
103
103
|
"eslint-plugin-depend": "^1.2.0",
|
|
104
104
|
"eslint-plugin-github-action": "^0.0.16",
|
|
105
|
-
"eslint-plugin-import-x": "^4.
|
|
105
|
+
"eslint-plugin-import-x": "^4.13.2",
|
|
106
106
|
"eslint-plugin-jsdoc": "^50.6.17",
|
|
107
107
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
108
108
|
"eslint-plugin-n": "^17.18.0",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"eslint-plugin-vue": "^10.1.0",
|
|
119
119
|
"eslint-plugin-yml": "^1.18.0",
|
|
120
120
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
121
|
-
"globals": "^16.
|
|
121
|
+
"globals": "^16.2.0",
|
|
122
122
|
"jsonc-eslint-parser": "^2.4.0",
|
|
123
123
|
"local-pkg": "^1.1.1",
|
|
124
124
|
"prettier": "^3.5.3",
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
"yaml-eslint-parser": "^1.3.0"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
|
-
"@ntnyq/prettier-config": "^2.
|
|
132
|
-
"@types/node": "^22.15.
|
|
131
|
+
"@ntnyq/prettier-config": "^2.2.0",
|
|
132
|
+
"@types/node": "^22.15.21",
|
|
133
133
|
"bumpp": "^10.1.1",
|
|
134
134
|
"eslint": "^9.27.0",
|
|
135
135
|
"eslint-plugin-eslint-plugin": "^6.4.0",
|
|
@@ -137,9 +137,9 @@
|
|
|
137
137
|
"husky": "^9.1.7",
|
|
138
138
|
"jiti": "^2.4.2",
|
|
139
139
|
"nano-staged": "^0.8.0",
|
|
140
|
-
"npm-run-all2": "^8.0.
|
|
141
|
-
"tinyglobby": "^0.2.
|
|
142
|
-
"tsdown": "^0.
|
|
140
|
+
"npm-run-all2": "^8.0.4",
|
|
141
|
+
"tinyglobby": "^0.2.14",
|
|
142
|
+
"tsdown": "^0.12.3",
|
|
143
143
|
"tsx": "^4.19.4",
|
|
144
144
|
"typescript": "^5.8.3",
|
|
145
145
|
"uncase": "^0.1.0",
|