@ntnyq/eslint-config 3.8.1 → 3.9.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 +19 -38
- package/dist/index.cjs +61 -4
- package/dist/index.d.cts +85 -21
- package/dist/index.d.ts +85 -21
- package/dist/index.js +120 -67
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -110,55 +110,36 @@ Check for detail in:
|
|
|
110
110
|
|
|
111
111
|
```ts
|
|
112
112
|
export interface ConfigOptions extends ConfigOptionsInternal {
|
|
113
|
-
node?: ConfigNodeOptions
|
|
114
|
-
|
|
115
|
-
jsdoc?: ConfigJsdocOptions
|
|
116
|
-
|
|
117
|
-
ignores?: ConfigIgnoresOptions
|
|
118
|
-
|
|
119
|
-
importX?: ConfigImportsOptions
|
|
120
|
-
|
|
121
113
|
command?: ConfigCommandOptions
|
|
122
|
-
|
|
123
114
|
comments?: ConfigCommentsOptions
|
|
124
|
-
|
|
115
|
+
ignores?: ConfigIgnoresOptions
|
|
116
|
+
importX?: ConfigImportXOptions
|
|
125
117
|
javascript?: ConfigJavaScriptOptions
|
|
126
|
-
|
|
118
|
+
jsdoc?: ConfigJsdocOptions
|
|
119
|
+
node?: ConfigNodeOptions
|
|
127
120
|
specials?: ConfigSpecialsOptions
|
|
128
121
|
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
/**
|
|
123
|
+
* bellow can be disabled
|
|
124
|
+
*/
|
|
125
|
+
antfu?: boolean | ConfigAntfuOptions
|
|
126
|
+
githubAction?: boolean | ConfigGitHubActionOptions
|
|
131
127
|
gitignore?: boolean | ConfigGitIgnoreOptions
|
|
132
|
-
|
|
128
|
+
jsonc?: boolean | ConfigJsoncOptions
|
|
129
|
+
markdown?: boolean | ConfigMarkdownOptions
|
|
130
|
+
perfectionist?: boolean | ConfigPerfectionistOptions
|
|
131
|
+
pinia?: boolean | ConfigPiniaOptions
|
|
132
|
+
prettier?: boolean | ConfigPrettierOptions
|
|
133
|
+
regexp?: boolean | ConfigRegexpOptions
|
|
134
|
+
sort?: boolean | ConfigSortOptions
|
|
133
135
|
stylistic?: boolean | ConfigStylisticOptions
|
|
134
|
-
|
|
136
|
+
test?: boolean | ConfigTestOptions
|
|
137
|
+
toml?: boolean | ConfigTomlOptions
|
|
135
138
|
typescript?: boolean | ConfigTypeScriptOptions
|
|
136
|
-
|
|
137
139
|
unicorn?: boolean | ConfigUnicornOptions
|
|
138
|
-
|
|
139
|
-
prettier?: boolean | ConfigPrettierOptions
|
|
140
|
-
|
|
141
|
-
perfectionist?: boolean | ConfigPerfectionistOptions
|
|
142
|
-
|
|
143
140
|
unocss?: boolean | ConfigUnoCSSOptions
|
|
144
|
-
|
|
145
|
-
regexp?: boolean | ConfigRegexpOptions
|
|
146
|
-
|
|
147
|
-
jsonc?: boolean | ConfigJsoncOptions
|
|
148
|
-
|
|
149
|
-
yml?: boolean | ConfigYmlOptions
|
|
150
|
-
|
|
151
|
-
markdown?: boolean | ConfigMarkdownOptions
|
|
152
|
-
|
|
153
|
-
toml?: boolean | ConfigTomlOptions
|
|
154
|
-
|
|
155
141
|
vue?: boolean | ConfigVueOptions
|
|
156
|
-
|
|
157
|
-
test?: boolean | ConfigTestOptions
|
|
158
|
-
|
|
159
|
-
antfu?: boolean | ConfigAntfuOptions
|
|
160
|
-
|
|
161
|
-
githubAction?: boolean | ConfigGitHubActionOptions
|
|
142
|
+
yml?: boolean | ConfigYmlOptions
|
|
162
143
|
}
|
|
163
144
|
```
|
|
164
145
|
|
package/dist/index.cjs
CHANGED
|
@@ -51,6 +51,7 @@ __export(src_exports, {
|
|
|
51
51
|
GLOB_MARKDOWN_CODE: () => GLOB_MARKDOWN_CODE,
|
|
52
52
|
GLOB_MARKDOWN_NESTED: () => GLOB_MARKDOWN_NESTED,
|
|
53
53
|
GLOB_NODE_MODULES: () => GLOB_NODE_MODULES,
|
|
54
|
+
GLOB_PINIA_STORE: () => GLOB_PINIA_STORE,
|
|
54
55
|
GLOB_POSTCSS: () => GLOB_POSTCSS,
|
|
55
56
|
GLOB_SCSS: () => GLOB_SCSS,
|
|
56
57
|
GLOB_SRC: () => GLOB_SRC,
|
|
@@ -73,6 +74,7 @@ __export(src_exports, {
|
|
|
73
74
|
getOverrides: () => getOverrides,
|
|
74
75
|
githubAction: () => githubAction,
|
|
75
76
|
gitignore: () => gitignore,
|
|
77
|
+
hasPinia: () => hasPinia,
|
|
76
78
|
hasTypeScript: () => hasTypeScript,
|
|
77
79
|
hasUnoCSS: () => hasUnoCSS,
|
|
78
80
|
hasVitest: () => hasVitest,
|
|
@@ -97,6 +99,7 @@ __export(src_exports, {
|
|
|
97
99
|
parserVue: () => parserVue,
|
|
98
100
|
parserYaml: () => parserYaml,
|
|
99
101
|
perfectionist: () => perfectionist,
|
|
102
|
+
pinia: () => pinia,
|
|
100
103
|
pluginAntfu: () => import_eslint_plugin_antfu.default,
|
|
101
104
|
pluginComments: () => import_eslint_plugin_eslint_comments.default,
|
|
102
105
|
pluginEsX: () => import_eslint_plugin_es_x.default,
|
|
@@ -109,6 +112,7 @@ __export(src_exports, {
|
|
|
109
112
|
pluginNode: () => import_eslint_plugin_n.default,
|
|
110
113
|
pluginNtnyq: () => import_eslint_plugin_ntnyq.default,
|
|
111
114
|
pluginPerfectionist: () => import_eslint_plugin_perfectionist.default,
|
|
115
|
+
pluginPinia: () => import_eslint_plugin_pinia.default,
|
|
112
116
|
pluginPrettier: () => import_eslint_plugin_prettier.default,
|
|
113
117
|
pluginRegexp: () => pluginRegexp,
|
|
114
118
|
pluginStylistic: () => import_eslint_plugin3.default,
|
|
@@ -183,6 +187,7 @@ var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1);
|
|
|
183
187
|
var import_eslint_plugin_es_x = __toESM(require("eslint-plugin-es-x"), 1);
|
|
184
188
|
var import_eslint_plugin_yml = __toESM(require("eslint-plugin-yml"), 1);
|
|
185
189
|
var import_eslint_plugin_toml = __toESM(require("eslint-plugin-toml"), 1);
|
|
190
|
+
var import_eslint_plugin_pinia = __toESM(require("eslint-plugin-pinia"), 1);
|
|
186
191
|
var import_eslint_plugin_ntnyq = __toESM(require("eslint-plugin-ntnyq"), 1);
|
|
187
192
|
var import_markdown = __toESM(require("@eslint/markdown"), 1);
|
|
188
193
|
var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
|
|
@@ -253,6 +258,7 @@ var GLOB_ALL_SRC = [
|
|
|
253
258
|
GLOB_HTML,
|
|
254
259
|
GLOB_MARKDOWN
|
|
255
260
|
];
|
|
261
|
+
var GLOB_PINIA_STORE = `**/store?(s)/*.${GLOB_SRC_EXT}`;
|
|
256
262
|
var GLOB_GITHUB_ACTION = "**/.github/workflows/*.y?(a)ml";
|
|
257
263
|
var GLOB_NODE_MODULES = "**/node_modules/**";
|
|
258
264
|
var GLOB_DIST = "**/dist/**";
|
|
@@ -1187,7 +1193,12 @@ var jsdoc = (options = {}) => [
|
|
|
1187
1193
|
definedTags: [
|
|
1188
1194
|
// magic-comments
|
|
1189
1195
|
"vite-ignore",
|
|
1190
|
-
"unocss-include"
|
|
1196
|
+
"unocss-include",
|
|
1197
|
+
// non-standard, but common used
|
|
1198
|
+
"compatibility",
|
|
1199
|
+
"category",
|
|
1200
|
+
"experimental",
|
|
1201
|
+
"internal"
|
|
1191
1202
|
]
|
|
1192
1203
|
}
|
|
1193
1204
|
],
|
|
@@ -1419,6 +1430,37 @@ var jsonc = (options = {}) => [
|
|
|
1419
1430
|
}
|
|
1420
1431
|
];
|
|
1421
1432
|
|
|
1433
|
+
// src/configs/pinia.ts
|
|
1434
|
+
var pinia = (options = {}) => {
|
|
1435
|
+
const { files = [GLOB_PINIA_STORE] } = options;
|
|
1436
|
+
return [
|
|
1437
|
+
{
|
|
1438
|
+
name: "ntnyq/pinia",
|
|
1439
|
+
files,
|
|
1440
|
+
plugins: {
|
|
1441
|
+
pinia: import_eslint_plugin_pinia.default
|
|
1442
|
+
},
|
|
1443
|
+
rules: {
|
|
1444
|
+
"pinia/prefer-single-store-per-file": "error",
|
|
1445
|
+
"pinia/no-duplicate-store-ids": "error",
|
|
1446
|
+
"pinia/no-return-global-properties": "error",
|
|
1447
|
+
"pinia/no-store-to-refs-in-store": "error",
|
|
1448
|
+
"pinia/never-export-initialized-store": "error",
|
|
1449
|
+
"pinia/require-setup-store-properties-export": "error",
|
|
1450
|
+
"pinia/prefer-use-store-naming-convention": [
|
|
1451
|
+
"error",
|
|
1452
|
+
{
|
|
1453
|
+
checkStoreNameMismatch: true,
|
|
1454
|
+
storeSuffix: "Store"
|
|
1455
|
+
}
|
|
1456
|
+
],
|
|
1457
|
+
// Overrides rules
|
|
1458
|
+
...options.overrides
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
];
|
|
1462
|
+
};
|
|
1463
|
+
|
|
1422
1464
|
// src/configs/ntnyq.ts
|
|
1423
1465
|
var ntnyq = (options = {}) => [
|
|
1424
1466
|
{
|
|
@@ -1440,7 +1482,7 @@ var regexp = (options = {}) => {
|
|
|
1440
1482
|
const recommendedRules2 = {
|
|
1441
1483
|
...recommendedConfig.rules
|
|
1442
1484
|
};
|
|
1443
|
-
if (options.level === "warn") {
|
|
1485
|
+
if (options.severity || options.level === "warn") {
|
|
1444
1486
|
for (const key in recommendedRules2) {
|
|
1445
1487
|
if (recommendedRules2[key] === "error") {
|
|
1446
1488
|
recommendedRules2[key] = "warn";
|
|
@@ -1534,6 +1576,7 @@ var hasVitest = (0, import_local_pkg.isPackageExists)("vitest");
|
|
|
1534
1576
|
var hasVue = (0, import_local_pkg.isPackageExists)("vue") || (0, import_local_pkg.isPackageExists)("nuxt") || (0, import_local_pkg.isPackageExists)("vitepress") || (0, import_local_pkg.isPackageExists)("@slidev/cli") || (0, import_local_pkg.isPackageExists)("vue", {
|
|
1535
1577
|
paths: [(0, import_node_path.resolve)(import_node_process.default.cwd(), "playground")]
|
|
1536
1578
|
});
|
|
1579
|
+
var hasPinia = (0, import_local_pkg.isPackageExists)("pinia");
|
|
1537
1580
|
var hasUnoCSS = (0, import_local_pkg.isPackageExists)("unocss") || (0, import_local_pkg.isPackageExists)("@unocss/postcss") || (0, import_local_pkg.isPackageExists)("@unocss/webpack") || (0, import_local_pkg.isPackageExists)("@unocss/nuxt");
|
|
1538
1581
|
|
|
1539
1582
|
// src/utils/toArray.ts
|
|
@@ -2019,7 +2062,7 @@ var prettier = (options = {}) => {
|
|
|
2019
2062
|
"vue/space-unary-ops": "off",
|
|
2020
2063
|
"vue/template-curly-spacing": "off",
|
|
2021
2064
|
...import_eslint_plugin_prettier.default.configs.recommended.rules,
|
|
2022
|
-
"prettier/prettier": options.level || "warn",
|
|
2065
|
+
"prettier/prettier": options.severity || options.level || "warn",
|
|
2023
2066
|
// Overrides rules
|
|
2024
2067
|
...options.overrides
|
|
2025
2068
|
}
|
|
@@ -2797,7 +2840,8 @@ var perfectionist = (options = {}) => {
|
|
|
2797
2840
|
{
|
|
2798
2841
|
type: "alphabetical",
|
|
2799
2842
|
order: "asc",
|
|
2800
|
-
partitionByComment: true
|
|
2843
|
+
partitionByComment: true,
|
|
2844
|
+
groups: ["unknown", "method", "multiline"]
|
|
2801
2845
|
}
|
|
2802
2846
|
],
|
|
2803
2847
|
"perfectionist/sort-sets": [
|
|
@@ -2864,6 +2908,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2864
2908
|
* Conditional by deps
|
|
2865
2909
|
*/
|
|
2866
2910
|
vue: enableVue = hasVue,
|
|
2911
|
+
pinia: enablePinia = hasPinia,
|
|
2867
2912
|
test: enableTest = hasVitest,
|
|
2868
2913
|
unocss: enableUnoCSS = hasUnoCSS,
|
|
2869
2914
|
typescript: enableTypeScript = hasTypeScript,
|
|
@@ -2934,6 +2979,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2934
2979
|
})
|
|
2935
2980
|
);
|
|
2936
2981
|
}
|
|
2982
|
+
if (enablePinia) {
|
|
2983
|
+
configs2.push(
|
|
2984
|
+
...pinia({
|
|
2985
|
+
...resolveSubOptions(options, "pinia"),
|
|
2986
|
+
overrides: getOverrides(options, "pinia")
|
|
2987
|
+
})
|
|
2988
|
+
);
|
|
2989
|
+
}
|
|
2937
2990
|
if (enableRegexp) {
|
|
2938
2991
|
configs2.push(
|
|
2939
2992
|
...regexp({
|
|
@@ -3072,6 +3125,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3072
3125
|
GLOB_MARKDOWN_CODE,
|
|
3073
3126
|
GLOB_MARKDOWN_NESTED,
|
|
3074
3127
|
GLOB_NODE_MODULES,
|
|
3128
|
+
GLOB_PINIA_STORE,
|
|
3075
3129
|
GLOB_POSTCSS,
|
|
3076
3130
|
GLOB_SCSS,
|
|
3077
3131
|
GLOB_SRC,
|
|
@@ -3094,6 +3148,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3094
3148
|
getOverrides,
|
|
3095
3149
|
githubAction,
|
|
3096
3150
|
gitignore,
|
|
3151
|
+
hasPinia,
|
|
3097
3152
|
hasTypeScript,
|
|
3098
3153
|
hasUnoCSS,
|
|
3099
3154
|
hasVitest,
|
|
@@ -3118,6 +3173,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3118
3173
|
parserVue,
|
|
3119
3174
|
parserYaml,
|
|
3120
3175
|
perfectionist,
|
|
3176
|
+
pinia,
|
|
3121
3177
|
pluginAntfu,
|
|
3122
3178
|
pluginComments,
|
|
3123
3179
|
pluginEsX,
|
|
@@ -3130,6 +3186,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3130
3186
|
pluginNode,
|
|
3131
3187
|
pluginNtnyq,
|
|
3132
3188
|
pluginPerfectionist,
|
|
3189
|
+
pluginPinia,
|
|
3133
3190
|
pluginPrettier,
|
|
3134
3191
|
pluginRegexp,
|
|
3135
3192
|
pluginStylistic,
|
package/dist/index.d.cts
CHANGED
|
@@ -9,6 +9,7 @@ import { Linter } from 'eslint';
|
|
|
9
9
|
import { ConfigWithExtends } from 'typescript-eslint';
|
|
10
10
|
export { plugin as pluginTypeScript, configs as typescriptConfigs } from 'typescript-eslint';
|
|
11
11
|
import { RequiredOptions, BuiltInParserName } from 'prettier';
|
|
12
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
12
13
|
import * as eslintPluginRegexp from 'eslint-plugin-regexp';
|
|
13
14
|
export { eslintPluginRegexp as pluginRegexp };
|
|
14
15
|
export { default as pluginNode } from 'eslint-plugin-n';
|
|
@@ -16,6 +17,7 @@ export { default as pluginVue } from 'eslint-plugin-vue';
|
|
|
16
17
|
export { default as pluginEsX } from 'eslint-plugin-es-x';
|
|
17
18
|
export { default as pluginYaml } from 'eslint-plugin-yml';
|
|
18
19
|
export { default as pluginToml } from 'eslint-plugin-toml';
|
|
20
|
+
export { default as pluginPinia } from 'eslint-plugin-pinia';
|
|
19
21
|
export { default as pluginNtnyq } from 'eslint-plugin-ntnyq';
|
|
20
22
|
export { default as pluginMarkdown } from '@eslint/markdown';
|
|
21
23
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
@@ -3091,6 +3093,11 @@ interface RuleOptions {
|
|
|
3091
3093
|
* @see https://eslint-plugin-github-action.ntnyq.com/rules/require-action-name.html
|
|
3092
3094
|
*/
|
|
3093
3095
|
'github-action/require-action-name'?: Linter.RuleEntry<[]>;
|
|
3096
|
+
/**
|
|
3097
|
+
* require action run-name to be set.
|
|
3098
|
+
* @see https://eslint-plugin-github-action.ntnyq.com/rules/require-action-run-name.html
|
|
3099
|
+
*/
|
|
3100
|
+
'github-action/require-action-run-name'?: Linter.RuleEntry<[]>;
|
|
3094
3101
|
/**
|
|
3095
3102
|
* require job name to be set.
|
|
3096
3103
|
* @see https://eslint-plugin-github-action.ntnyq.com/rules/require-job-name.html
|
|
@@ -5243,6 +5250,41 @@ interface RuleOptions {
|
|
|
5243
5250
|
* @see https://perfectionist.dev/rules/sort-variable-declarations
|
|
5244
5251
|
*/
|
|
5245
5252
|
'perfectionist/sort-variable-declarations'?: Linter.RuleEntry<PerfectionistSortVariableDeclarations>;
|
|
5253
|
+
/**
|
|
5254
|
+
* Never export an initialized named or default store.
|
|
5255
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/never-export-initialized-store.md
|
|
5256
|
+
*/
|
|
5257
|
+
'pinia/never-export-initialized-store'?: Linter.RuleEntry<[]>;
|
|
5258
|
+
/**
|
|
5259
|
+
* Disallow duplicate store ids.
|
|
5260
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/no-duplicate-store-ids.md
|
|
5261
|
+
*/
|
|
5262
|
+
'pinia/no-duplicate-store-ids'?: Linter.RuleEntry<[]>;
|
|
5263
|
+
/**
|
|
5264
|
+
* Disallows returning globally provided properties from Pinia stores.
|
|
5265
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/no-return-global-properties.md
|
|
5266
|
+
*/
|
|
5267
|
+
'pinia/no-return-global-properties'?: Linter.RuleEntry<[]>;
|
|
5268
|
+
/**
|
|
5269
|
+
* Disallow use of storeToRefs inside defineStore
|
|
5270
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/no-store-to-refs-in-store.md
|
|
5271
|
+
*/
|
|
5272
|
+
'pinia/no-store-to-refs-in-store'?: Linter.RuleEntry<[]>;
|
|
5273
|
+
/**
|
|
5274
|
+
* Encourages defining each store in a separate file.
|
|
5275
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/prefer-single-store-per-file.md
|
|
5276
|
+
*/
|
|
5277
|
+
'pinia/prefer-single-store-per-file'?: Linter.RuleEntry<[]>;
|
|
5278
|
+
/**
|
|
5279
|
+
* Enforces the convention of naming stores with the prefix `use` followed by the store name.
|
|
5280
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/prefer-use-store-naming-convention.md
|
|
5281
|
+
*/
|
|
5282
|
+
'pinia/prefer-use-store-naming-convention'?: Linter.RuleEntry<PiniaPreferUseStoreNamingConvention>;
|
|
5283
|
+
/**
|
|
5284
|
+
* In setup stores all state properties must be exported.
|
|
5285
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/require-setup-store-properties-export.md
|
|
5286
|
+
*/
|
|
5287
|
+
'pinia/require-setup-store-properties-export'?: Linter.RuleEntry<[]>;
|
|
5246
5288
|
/**
|
|
5247
5289
|
* Require using arrow functions for callbacks
|
|
5248
5290
|
* @see https://eslint.org/docs/latest/rules/prefer-arrow-callback
|
|
@@ -14538,6 +14580,13 @@ type PerfectionistSortVariableDeclarations = [] | [
|
|
|
14538
14580
|
type?: ("alphabetical" | "natural" | "line-length");
|
|
14539
14581
|
}
|
|
14540
14582
|
];
|
|
14583
|
+
type PiniaPreferUseStoreNamingConvention = [] | [
|
|
14584
|
+
{
|
|
14585
|
+
checkStoreNameMismatch?: boolean;
|
|
14586
|
+
storeSuffix?: string;
|
|
14587
|
+
[k: string]: unknown | undefined;
|
|
14588
|
+
}
|
|
14589
|
+
];
|
|
14541
14590
|
type PreferArrowCallback = [] | [
|
|
14542
14591
|
{
|
|
14543
14592
|
allowNamedFunctions?: boolean;
|
|
@@ -16966,7 +17015,7 @@ type Yoda = [] | [("always" | "never")] | [
|
|
|
16966
17015
|
onlyEquality?: boolean;
|
|
16967
17016
|
}
|
|
16968
17017
|
];
|
|
16969
|
-
type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/es-x' | 'ntnyq/format/setup' | 'ntnyq/format/css' | 'ntnyq/format/scss' | 'ntnyq/format/less' | 'ntnyq/format/html' | 'ntnyq/github-action' | 'ntnyq/gitignore' | 'ntnyq/ignores' | 'ntnyq/import-x' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/processor' | 'ntnyq/markdown/parser' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/ntnyq' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/perfectionist/common' | 'ntnyq/perfectionist/enums' | 'ntnyq/perfectionist/types' | 'ntnyq/perfectionist/constants' | 'ntnyq/regexp' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'ntnyq/sort/pnpm-workspace' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/userscript' | 'ntnyq/specials/config-file' | 'ntnyq/stylistic' | 'ntnyq/toml' | 'ntnyq/ts/setup' | 'ntnyq/ts/parser' | 'ntnyq/ts/rules' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'ntnyq/vitest' | 'ntnyq/vue/setup' | 'ntnyq/vue/rules' | 'ntnyq/yaml';
|
|
17018
|
+
type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/es-x' | 'ntnyq/format/setup' | 'ntnyq/format/css' | 'ntnyq/format/scss' | 'ntnyq/format/less' | 'ntnyq/format/html' | 'ntnyq/github-action' | 'ntnyq/gitignore' | 'ntnyq/ignores' | 'ntnyq/import-x' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/processor' | 'ntnyq/markdown/parser' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/ntnyq' | 'ntnyq/pinia' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/perfectionist/common' | 'ntnyq/perfectionist/enums' | 'ntnyq/perfectionist/types' | 'ntnyq/perfectionist/constants' | 'ntnyq/regexp' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'ntnyq/sort/pnpm-workspace' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/userscript' | 'ntnyq/specials/config-file' | 'ntnyq/stylistic' | 'ntnyq/toml' | 'ntnyq/ts/setup' | 'ntnyq/ts/parser' | 'ntnyq/ts/rules' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'ntnyq/vitest' | 'ntnyq/vue/setup' | 'ntnyq/vue/rules' | 'ntnyq/yaml';
|
|
16970
17019
|
|
|
16971
17020
|
/**
|
|
16972
17021
|
* ESLint config
|
|
@@ -16984,6 +17033,12 @@ type ESLintProcessor = Linter.Processor;
|
|
|
16984
17033
|
* ESLint parserOptions
|
|
16985
17034
|
*/
|
|
16986
17035
|
type ESLintParserOptions = Linter.ParserOptions;
|
|
17036
|
+
/**
|
|
17037
|
+
* ESLint rule severity
|
|
17038
|
+
*
|
|
17039
|
+
* for config options use, don't need `off`
|
|
17040
|
+
*/
|
|
17041
|
+
type ESLintRuleSeverity = 'error' | 'warn';
|
|
16987
17042
|
/**
|
|
16988
17043
|
* TypeScript ESLint parserOptions
|
|
16989
17044
|
*/
|
|
@@ -17033,6 +17088,8 @@ interface ConfigNodeOptions extends OptionsOverrides {
|
|
|
17033
17088
|
}
|
|
17034
17089
|
interface ConfigNtnyqOptions extends OptionsOverrides {
|
|
17035
17090
|
}
|
|
17091
|
+
interface ConfigPiniaOptions extends OptionsFiles, OptionsOverrides {
|
|
17092
|
+
}
|
|
17036
17093
|
interface ConfigStylisticOptions extends OptionsOverrides {
|
|
17037
17094
|
}
|
|
17038
17095
|
interface ConfigTomlOptions extends OptionsOverrides {
|
|
@@ -17136,28 +17193,41 @@ interface ConfigPerfectionistOptions extends OptionsOverrides {
|
|
|
17136
17193
|
}
|
|
17137
17194
|
interface ConfigPrettierOptions extends OptionsOverrides {
|
|
17138
17195
|
/**
|
|
17139
|
-
*
|
|
17196
|
+
* TODO: remove in next major version
|
|
17140
17197
|
*
|
|
17141
|
-
* @
|
|
17198
|
+
* @deprecated use `severity` instead
|
|
17142
17199
|
*/
|
|
17143
|
-
level?:
|
|
17200
|
+
level?: ESLintRuleSeverity;
|
|
17201
|
+
/**
|
|
17202
|
+
* rule severity
|
|
17203
|
+
*
|
|
17204
|
+
* @default `warn`
|
|
17205
|
+
*/
|
|
17206
|
+
severity?: ESLintRuleSeverity;
|
|
17144
17207
|
/**
|
|
17145
17208
|
* Glob of built-in disabled files
|
|
17146
17209
|
*/
|
|
17147
17210
|
disabledFiles?: string[];
|
|
17148
17211
|
/**
|
|
17149
17212
|
* Glob of user custom disabled files
|
|
17213
|
+
*
|
|
17150
17214
|
* @default []
|
|
17151
17215
|
*/
|
|
17152
17216
|
userDisabledFiles?: string[];
|
|
17153
17217
|
}
|
|
17154
17218
|
interface ConfigRegexpOptions extends OptionsOverrides {
|
|
17155
17219
|
/**
|
|
17156
|
-
*
|
|
17220
|
+
* TODO: remove in next major version
|
|
17221
|
+
*
|
|
17222
|
+
* @deprecated use `severity` instead
|
|
17223
|
+
*/
|
|
17224
|
+
level?: ESLintRuleSeverity;
|
|
17225
|
+
/**
|
|
17226
|
+
* rule severity
|
|
17157
17227
|
*
|
|
17158
17228
|
* @default 'error'
|
|
17159
17229
|
*/
|
|
17160
|
-
|
|
17230
|
+
severity?: ESLintRuleSeverity;
|
|
17161
17231
|
}
|
|
17162
17232
|
interface ConfigSortOptions {
|
|
17163
17233
|
/**
|
|
@@ -17242,6 +17312,7 @@ interface ConfigVueOptions extends OptionsFeatures, OptionsFiles, OptionsOverrid
|
|
|
17242
17312
|
* Create virtual files for Vue SFC blocks to enable linting.
|
|
17243
17313
|
*
|
|
17244
17314
|
* @see https://github.com/antfu/eslint-processor-vue-blocks
|
|
17315
|
+
*
|
|
17245
17316
|
* @default true
|
|
17246
17317
|
*/
|
|
17247
17318
|
sfcBlocks?: boolean | Options;
|
|
@@ -17285,6 +17356,7 @@ interface ConfigOptions extends ConfigOptionsInternal, OptionsExtensions {
|
|
|
17285
17356
|
jsonc?: boolean | ConfigJsoncOptions;
|
|
17286
17357
|
markdown?: boolean | ConfigMarkdownOptions;
|
|
17287
17358
|
perfectionist?: boolean | ConfigPerfectionistOptions;
|
|
17359
|
+
pinia?: boolean | ConfigPiniaOptions;
|
|
17288
17360
|
prettier?: boolean | ConfigPrettierOptions;
|
|
17289
17361
|
regexp?: boolean | ConfigRegexpOptions;
|
|
17290
17362
|
sort?: boolean | ConfigSortOptions;
|
|
@@ -17345,6 +17417,7 @@ declare const GLOB_MARKDOWN = "**/*.md";
|
|
|
17345
17417
|
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
17346
17418
|
declare const GLOB_MARKDOWN_NESTED = "**/*.md/*.md";
|
|
17347
17419
|
declare const GLOB_ALL_SRC: string[];
|
|
17420
|
+
declare const GLOB_PINIA_STORE = "**/store?(s)/*.?([cm])[jt]s?(x)";
|
|
17348
17421
|
declare const GLOB_GITHUB_ACTION = "**/.github/workflows/*.y?(a)ml";
|
|
17349
17422
|
declare const GLOB_NODE_MODULES = "**/node_modules/**";
|
|
17350
17423
|
declare const GLOB_DIST = "**/dist/**";
|
|
@@ -17354,6 +17427,7 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
17354
17427
|
declare const hasTypeScript: boolean;
|
|
17355
17428
|
declare const hasVitest: boolean;
|
|
17356
17429
|
declare const hasVue: boolean;
|
|
17430
|
+
declare const hasPinia: boolean;
|
|
17357
17431
|
declare const hasUnoCSS: boolean;
|
|
17358
17432
|
|
|
17359
17433
|
declare function toArray<T>(val?: Arrayable<T>): T[];
|
|
@@ -17382,24 +17456,12 @@ declare function resolveSubOptions<K extends keyof ConfigOptions>(options: Confi
|
|
|
17382
17456
|
|
|
17383
17457
|
declare function mergePrettierOptions(options?: PrettierOptions, overrides?: PrettierOptions): PrettierOptions;
|
|
17384
17458
|
|
|
17385
|
-
/**
|
|
17386
|
-
* @file ESLint parsers
|
|
17387
|
-
*/
|
|
17388
|
-
|
|
17389
17459
|
/**
|
|
17390
17460
|
* With meta
|
|
17391
17461
|
*/
|
|
17392
17462
|
declare const parserTypeScript: {
|
|
17393
|
-
meta?: {
|
|
17394
|
-
|
|
17395
|
-
version?: string | undefined;
|
|
17396
|
-
};
|
|
17397
|
-
parseForESLint(text: string, options?: unknown): {
|
|
17398
|
-
ast: unknown;
|
|
17399
|
-
scopeManager?: unknown;
|
|
17400
|
-
services?: unknown;
|
|
17401
|
-
visitorKeys?: unknown;
|
|
17402
|
-
};
|
|
17463
|
+
meta?: { [K in keyof _typescript_eslint_utils_ts_eslint.Parser.ParserMeta]?: _typescript_eslint_utils_ts_eslint.Parser.ParserMeta[K] | undefined; };
|
|
17464
|
+
parseForESLint(text: string, options?: unknown): { [k in keyof _typescript_eslint_utils_ts_eslint.Parser.ParseResult]: unknown; };
|
|
17403
17465
|
};
|
|
17404
17466
|
|
|
17405
17467
|
/**
|
|
@@ -17428,6 +17490,8 @@ declare const jsdoc: (options?: ConfigJsdocOptions) => TypedConfigItem[];
|
|
|
17428
17490
|
|
|
17429
17491
|
declare const jsonc: (options?: ConfigJsoncOptions) => TypedConfigItem[];
|
|
17430
17492
|
|
|
17493
|
+
declare const pinia: (options?: ConfigPiniaOptions) => TypedConfigItem[];
|
|
17494
|
+
|
|
17431
17495
|
declare const ntnyq: (options?: ConfigNtnyqOptions) => TypedConfigItem[];
|
|
17432
17496
|
|
|
17433
17497
|
/**
|
|
@@ -17483,4 +17547,4 @@ declare const unusedImports: (options?: ConfigUnusedImportsOptions) => TypedConf
|
|
|
17483
17547
|
*/
|
|
17484
17548
|
declare const DEFAULT_PRETTIER_OPTIONS: PrettierOptions;
|
|
17485
17549
|
|
|
17486
|
-
export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigEsXOptions, type ConfigFormatOptions, type ConfigGitHubActionOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportXOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigNtnyqOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigSortOptions, type ConfigSpecialsOptions, type ConfigStylisticOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, DEFAULT_PRETTIER_OPTIONS, type ESLintConfig, type ESLintParser, type ESLintParserOptions, type ESLintProcessor, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_TYPES, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsExtensions, type OptionsFeatures, type OptionsFiles, type OptionsOverrides, type PrettierOptions, type Pretty, type ResolvedOptions, type RuleOptions, type TSESLintParserOptions, type TypedConfigItem, antfu, command, comments, defineESLintConfig, esX, format, getOverrides, githubAction, gitignore, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, importX, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, mergePrettierOptions, node, ntnyq, parserPlain, parserTypeScript, perfectionist, prettier, regexp, resolveSubOptions, sort, specials, stylistic, test, toArray, toml, typescript, unicorn, unocss, unusedImports, vitest, vue, yml };
|
|
17550
|
+
export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigEsXOptions, type ConfigFormatOptions, type ConfigGitHubActionOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportXOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigNtnyqOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPiniaOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigSortOptions, type ConfigSpecialsOptions, type ConfigStylisticOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, DEFAULT_PRETTIER_OPTIONS, type ESLintConfig, type ESLintParser, type ESLintParserOptions, type ESLintProcessor, type ESLintRuleSeverity, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PINIA_STORE, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_TYPES, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsExtensions, type OptionsFeatures, type OptionsFiles, type OptionsOverrides, type PrettierOptions, type Pretty, type ResolvedOptions, type RuleOptions, type TSESLintParserOptions, type TypedConfigItem, antfu, command, comments, defineESLintConfig, esX, format, getOverrides, githubAction, gitignore, hasPinia, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, importX, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, mergePrettierOptions, node, ntnyq, parserPlain, parserTypeScript, perfectionist, pinia, prettier, regexp, resolveSubOptions, sort, specials, stylistic, test, toArray, toml, typescript, unicorn, unocss, unusedImports, vitest, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Linter } from 'eslint';
|
|
|
9
9
|
import { ConfigWithExtends } from 'typescript-eslint';
|
|
10
10
|
export { plugin as pluginTypeScript, configs as typescriptConfigs } from 'typescript-eslint';
|
|
11
11
|
import { RequiredOptions, BuiltInParserName } from 'prettier';
|
|
12
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
12
13
|
import * as eslintPluginRegexp from 'eslint-plugin-regexp';
|
|
13
14
|
export { eslintPluginRegexp as pluginRegexp };
|
|
14
15
|
export { default as pluginNode } from 'eslint-plugin-n';
|
|
@@ -16,6 +17,7 @@ export { default as pluginVue } from 'eslint-plugin-vue';
|
|
|
16
17
|
export { default as pluginEsX } from 'eslint-plugin-es-x';
|
|
17
18
|
export { default as pluginYaml } from 'eslint-plugin-yml';
|
|
18
19
|
export { default as pluginToml } from 'eslint-plugin-toml';
|
|
20
|
+
export { default as pluginPinia } from 'eslint-plugin-pinia';
|
|
19
21
|
export { default as pluginNtnyq } from 'eslint-plugin-ntnyq';
|
|
20
22
|
export { default as pluginMarkdown } from '@eslint/markdown';
|
|
21
23
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
@@ -3091,6 +3093,11 @@ interface RuleOptions {
|
|
|
3091
3093
|
* @see https://eslint-plugin-github-action.ntnyq.com/rules/require-action-name.html
|
|
3092
3094
|
*/
|
|
3093
3095
|
'github-action/require-action-name'?: Linter.RuleEntry<[]>;
|
|
3096
|
+
/**
|
|
3097
|
+
* require action run-name to be set.
|
|
3098
|
+
* @see https://eslint-plugin-github-action.ntnyq.com/rules/require-action-run-name.html
|
|
3099
|
+
*/
|
|
3100
|
+
'github-action/require-action-run-name'?: Linter.RuleEntry<[]>;
|
|
3094
3101
|
/**
|
|
3095
3102
|
* require job name to be set.
|
|
3096
3103
|
* @see https://eslint-plugin-github-action.ntnyq.com/rules/require-job-name.html
|
|
@@ -5243,6 +5250,41 @@ interface RuleOptions {
|
|
|
5243
5250
|
* @see https://perfectionist.dev/rules/sort-variable-declarations
|
|
5244
5251
|
*/
|
|
5245
5252
|
'perfectionist/sort-variable-declarations'?: Linter.RuleEntry<PerfectionistSortVariableDeclarations>;
|
|
5253
|
+
/**
|
|
5254
|
+
* Never export an initialized named or default store.
|
|
5255
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/never-export-initialized-store.md
|
|
5256
|
+
*/
|
|
5257
|
+
'pinia/never-export-initialized-store'?: Linter.RuleEntry<[]>;
|
|
5258
|
+
/**
|
|
5259
|
+
* Disallow duplicate store ids.
|
|
5260
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/no-duplicate-store-ids.md
|
|
5261
|
+
*/
|
|
5262
|
+
'pinia/no-duplicate-store-ids'?: Linter.RuleEntry<[]>;
|
|
5263
|
+
/**
|
|
5264
|
+
* Disallows returning globally provided properties from Pinia stores.
|
|
5265
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/no-return-global-properties.md
|
|
5266
|
+
*/
|
|
5267
|
+
'pinia/no-return-global-properties'?: Linter.RuleEntry<[]>;
|
|
5268
|
+
/**
|
|
5269
|
+
* Disallow use of storeToRefs inside defineStore
|
|
5270
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/no-store-to-refs-in-store.md
|
|
5271
|
+
*/
|
|
5272
|
+
'pinia/no-store-to-refs-in-store'?: Linter.RuleEntry<[]>;
|
|
5273
|
+
/**
|
|
5274
|
+
* Encourages defining each store in a separate file.
|
|
5275
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/prefer-single-store-per-file.md
|
|
5276
|
+
*/
|
|
5277
|
+
'pinia/prefer-single-store-per-file'?: Linter.RuleEntry<[]>;
|
|
5278
|
+
/**
|
|
5279
|
+
* Enforces the convention of naming stores with the prefix `use` followed by the store name.
|
|
5280
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/prefer-use-store-naming-convention.md
|
|
5281
|
+
*/
|
|
5282
|
+
'pinia/prefer-use-store-naming-convention'?: Linter.RuleEntry<PiniaPreferUseStoreNamingConvention>;
|
|
5283
|
+
/**
|
|
5284
|
+
* In setup stores all state properties must be exported.
|
|
5285
|
+
* @see https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/docs/rules/require-setup-store-properties-export.md
|
|
5286
|
+
*/
|
|
5287
|
+
'pinia/require-setup-store-properties-export'?: Linter.RuleEntry<[]>;
|
|
5246
5288
|
/**
|
|
5247
5289
|
* Require using arrow functions for callbacks
|
|
5248
5290
|
* @see https://eslint.org/docs/latest/rules/prefer-arrow-callback
|
|
@@ -14538,6 +14580,13 @@ type PerfectionistSortVariableDeclarations = [] | [
|
|
|
14538
14580
|
type?: ("alphabetical" | "natural" | "line-length");
|
|
14539
14581
|
}
|
|
14540
14582
|
];
|
|
14583
|
+
type PiniaPreferUseStoreNamingConvention = [] | [
|
|
14584
|
+
{
|
|
14585
|
+
checkStoreNameMismatch?: boolean;
|
|
14586
|
+
storeSuffix?: string;
|
|
14587
|
+
[k: string]: unknown | undefined;
|
|
14588
|
+
}
|
|
14589
|
+
];
|
|
14541
14590
|
type PreferArrowCallback = [] | [
|
|
14542
14591
|
{
|
|
14543
14592
|
allowNamedFunctions?: boolean;
|
|
@@ -16966,7 +17015,7 @@ type Yoda = [] | [("always" | "never")] | [
|
|
|
16966
17015
|
onlyEquality?: boolean;
|
|
16967
17016
|
}
|
|
16968
17017
|
];
|
|
16969
|
-
type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/es-x' | 'ntnyq/format/setup' | 'ntnyq/format/css' | 'ntnyq/format/scss' | 'ntnyq/format/less' | 'ntnyq/format/html' | 'ntnyq/github-action' | 'ntnyq/gitignore' | 'ntnyq/ignores' | 'ntnyq/import-x' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/processor' | 'ntnyq/markdown/parser' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/ntnyq' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/perfectionist/common' | 'ntnyq/perfectionist/enums' | 'ntnyq/perfectionist/types' | 'ntnyq/perfectionist/constants' | 'ntnyq/regexp' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'ntnyq/sort/pnpm-workspace' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/userscript' | 'ntnyq/specials/config-file' | 'ntnyq/stylistic' | 'ntnyq/toml' | 'ntnyq/ts/setup' | 'ntnyq/ts/parser' | 'ntnyq/ts/rules' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'ntnyq/vitest' | 'ntnyq/vue/setup' | 'ntnyq/vue/rules' | 'ntnyq/yaml';
|
|
17018
|
+
type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/es-x' | 'ntnyq/format/setup' | 'ntnyq/format/css' | 'ntnyq/format/scss' | 'ntnyq/format/less' | 'ntnyq/format/html' | 'ntnyq/github-action' | 'ntnyq/gitignore' | 'ntnyq/ignores' | 'ntnyq/import-x' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/processor' | 'ntnyq/markdown/parser' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/ntnyq' | 'ntnyq/pinia' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/perfectionist/common' | 'ntnyq/perfectionist/enums' | 'ntnyq/perfectionist/types' | 'ntnyq/perfectionist/constants' | 'ntnyq/regexp' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'ntnyq/sort/pnpm-workspace' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/userscript' | 'ntnyq/specials/config-file' | 'ntnyq/stylistic' | 'ntnyq/toml' | 'ntnyq/ts/setup' | 'ntnyq/ts/parser' | 'ntnyq/ts/rules' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'ntnyq/vitest' | 'ntnyq/vue/setup' | 'ntnyq/vue/rules' | 'ntnyq/yaml';
|
|
16970
17019
|
|
|
16971
17020
|
/**
|
|
16972
17021
|
* ESLint config
|
|
@@ -16984,6 +17033,12 @@ type ESLintProcessor = Linter.Processor;
|
|
|
16984
17033
|
* ESLint parserOptions
|
|
16985
17034
|
*/
|
|
16986
17035
|
type ESLintParserOptions = Linter.ParserOptions;
|
|
17036
|
+
/**
|
|
17037
|
+
* ESLint rule severity
|
|
17038
|
+
*
|
|
17039
|
+
* for config options use, don't need `off`
|
|
17040
|
+
*/
|
|
17041
|
+
type ESLintRuleSeverity = 'error' | 'warn';
|
|
16987
17042
|
/**
|
|
16988
17043
|
* TypeScript ESLint parserOptions
|
|
16989
17044
|
*/
|
|
@@ -17033,6 +17088,8 @@ interface ConfigNodeOptions extends OptionsOverrides {
|
|
|
17033
17088
|
}
|
|
17034
17089
|
interface ConfigNtnyqOptions extends OptionsOverrides {
|
|
17035
17090
|
}
|
|
17091
|
+
interface ConfigPiniaOptions extends OptionsFiles, OptionsOverrides {
|
|
17092
|
+
}
|
|
17036
17093
|
interface ConfigStylisticOptions extends OptionsOverrides {
|
|
17037
17094
|
}
|
|
17038
17095
|
interface ConfigTomlOptions extends OptionsOverrides {
|
|
@@ -17136,28 +17193,41 @@ interface ConfigPerfectionistOptions extends OptionsOverrides {
|
|
|
17136
17193
|
}
|
|
17137
17194
|
interface ConfigPrettierOptions extends OptionsOverrides {
|
|
17138
17195
|
/**
|
|
17139
|
-
*
|
|
17196
|
+
* TODO: remove in next major version
|
|
17140
17197
|
*
|
|
17141
|
-
* @
|
|
17198
|
+
* @deprecated use `severity` instead
|
|
17142
17199
|
*/
|
|
17143
|
-
level?:
|
|
17200
|
+
level?: ESLintRuleSeverity;
|
|
17201
|
+
/**
|
|
17202
|
+
* rule severity
|
|
17203
|
+
*
|
|
17204
|
+
* @default `warn`
|
|
17205
|
+
*/
|
|
17206
|
+
severity?: ESLintRuleSeverity;
|
|
17144
17207
|
/**
|
|
17145
17208
|
* Glob of built-in disabled files
|
|
17146
17209
|
*/
|
|
17147
17210
|
disabledFiles?: string[];
|
|
17148
17211
|
/**
|
|
17149
17212
|
* Glob of user custom disabled files
|
|
17213
|
+
*
|
|
17150
17214
|
* @default []
|
|
17151
17215
|
*/
|
|
17152
17216
|
userDisabledFiles?: string[];
|
|
17153
17217
|
}
|
|
17154
17218
|
interface ConfigRegexpOptions extends OptionsOverrides {
|
|
17155
17219
|
/**
|
|
17156
|
-
*
|
|
17220
|
+
* TODO: remove in next major version
|
|
17221
|
+
*
|
|
17222
|
+
* @deprecated use `severity` instead
|
|
17223
|
+
*/
|
|
17224
|
+
level?: ESLintRuleSeverity;
|
|
17225
|
+
/**
|
|
17226
|
+
* rule severity
|
|
17157
17227
|
*
|
|
17158
17228
|
* @default 'error'
|
|
17159
17229
|
*/
|
|
17160
|
-
|
|
17230
|
+
severity?: ESLintRuleSeverity;
|
|
17161
17231
|
}
|
|
17162
17232
|
interface ConfigSortOptions {
|
|
17163
17233
|
/**
|
|
@@ -17242,6 +17312,7 @@ interface ConfigVueOptions extends OptionsFeatures, OptionsFiles, OptionsOverrid
|
|
|
17242
17312
|
* Create virtual files for Vue SFC blocks to enable linting.
|
|
17243
17313
|
*
|
|
17244
17314
|
* @see https://github.com/antfu/eslint-processor-vue-blocks
|
|
17315
|
+
*
|
|
17245
17316
|
* @default true
|
|
17246
17317
|
*/
|
|
17247
17318
|
sfcBlocks?: boolean | Options;
|
|
@@ -17285,6 +17356,7 @@ interface ConfigOptions extends ConfigOptionsInternal, OptionsExtensions {
|
|
|
17285
17356
|
jsonc?: boolean | ConfigJsoncOptions;
|
|
17286
17357
|
markdown?: boolean | ConfigMarkdownOptions;
|
|
17287
17358
|
perfectionist?: boolean | ConfigPerfectionistOptions;
|
|
17359
|
+
pinia?: boolean | ConfigPiniaOptions;
|
|
17288
17360
|
prettier?: boolean | ConfigPrettierOptions;
|
|
17289
17361
|
regexp?: boolean | ConfigRegexpOptions;
|
|
17290
17362
|
sort?: boolean | ConfigSortOptions;
|
|
@@ -17345,6 +17417,7 @@ declare const GLOB_MARKDOWN = "**/*.md";
|
|
|
17345
17417
|
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
17346
17418
|
declare const GLOB_MARKDOWN_NESTED = "**/*.md/*.md";
|
|
17347
17419
|
declare const GLOB_ALL_SRC: string[];
|
|
17420
|
+
declare const GLOB_PINIA_STORE = "**/store?(s)/*.?([cm])[jt]s?(x)";
|
|
17348
17421
|
declare const GLOB_GITHUB_ACTION = "**/.github/workflows/*.y?(a)ml";
|
|
17349
17422
|
declare const GLOB_NODE_MODULES = "**/node_modules/**";
|
|
17350
17423
|
declare const GLOB_DIST = "**/dist/**";
|
|
@@ -17354,6 +17427,7 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
17354
17427
|
declare const hasTypeScript: boolean;
|
|
17355
17428
|
declare const hasVitest: boolean;
|
|
17356
17429
|
declare const hasVue: boolean;
|
|
17430
|
+
declare const hasPinia: boolean;
|
|
17357
17431
|
declare const hasUnoCSS: boolean;
|
|
17358
17432
|
|
|
17359
17433
|
declare function toArray<T>(val?: Arrayable<T>): T[];
|
|
@@ -17382,24 +17456,12 @@ declare function resolveSubOptions<K extends keyof ConfigOptions>(options: Confi
|
|
|
17382
17456
|
|
|
17383
17457
|
declare function mergePrettierOptions(options?: PrettierOptions, overrides?: PrettierOptions): PrettierOptions;
|
|
17384
17458
|
|
|
17385
|
-
/**
|
|
17386
|
-
* @file ESLint parsers
|
|
17387
|
-
*/
|
|
17388
|
-
|
|
17389
17459
|
/**
|
|
17390
17460
|
* With meta
|
|
17391
17461
|
*/
|
|
17392
17462
|
declare const parserTypeScript: {
|
|
17393
|
-
meta?: {
|
|
17394
|
-
|
|
17395
|
-
version?: string | undefined;
|
|
17396
|
-
};
|
|
17397
|
-
parseForESLint(text: string, options?: unknown): {
|
|
17398
|
-
ast: unknown;
|
|
17399
|
-
scopeManager?: unknown;
|
|
17400
|
-
services?: unknown;
|
|
17401
|
-
visitorKeys?: unknown;
|
|
17402
|
-
};
|
|
17463
|
+
meta?: { [K in keyof _typescript_eslint_utils_ts_eslint.Parser.ParserMeta]?: _typescript_eslint_utils_ts_eslint.Parser.ParserMeta[K] | undefined; };
|
|
17464
|
+
parseForESLint(text: string, options?: unknown): { [k in keyof _typescript_eslint_utils_ts_eslint.Parser.ParseResult]: unknown; };
|
|
17403
17465
|
};
|
|
17404
17466
|
|
|
17405
17467
|
/**
|
|
@@ -17428,6 +17490,8 @@ declare const jsdoc: (options?: ConfigJsdocOptions) => TypedConfigItem[];
|
|
|
17428
17490
|
|
|
17429
17491
|
declare const jsonc: (options?: ConfigJsoncOptions) => TypedConfigItem[];
|
|
17430
17492
|
|
|
17493
|
+
declare const pinia: (options?: ConfigPiniaOptions) => TypedConfigItem[];
|
|
17494
|
+
|
|
17431
17495
|
declare const ntnyq: (options?: ConfigNtnyqOptions) => TypedConfigItem[];
|
|
17432
17496
|
|
|
17433
17497
|
/**
|
|
@@ -17483,4 +17547,4 @@ declare const unusedImports: (options?: ConfigUnusedImportsOptions) => TypedConf
|
|
|
17483
17547
|
*/
|
|
17484
17548
|
declare const DEFAULT_PRETTIER_OPTIONS: PrettierOptions;
|
|
17485
17549
|
|
|
17486
|
-
export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigEsXOptions, type ConfigFormatOptions, type ConfigGitHubActionOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportXOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigNtnyqOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigSortOptions, type ConfigSpecialsOptions, type ConfigStylisticOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, DEFAULT_PRETTIER_OPTIONS, type ESLintConfig, type ESLintParser, type ESLintParserOptions, type ESLintProcessor, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_TYPES, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsExtensions, type OptionsFeatures, type OptionsFiles, type OptionsOverrides, type PrettierOptions, type Pretty, type ResolvedOptions, type RuleOptions, type TSESLintParserOptions, type TypedConfigItem, antfu, command, comments, defineESLintConfig, esX, format, getOverrides, githubAction, gitignore, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, importX, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, mergePrettierOptions, node, ntnyq, parserPlain, parserTypeScript, perfectionist, prettier, regexp, resolveSubOptions, sort, specials, stylistic, test, toArray, toml, typescript, unicorn, unocss, unusedImports, vitest, vue, yml };
|
|
17550
|
+
export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigEsXOptions, type ConfigFormatOptions, type ConfigGitHubActionOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportXOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigNtnyqOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPiniaOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigSortOptions, type ConfigSpecialsOptions, type ConfigStylisticOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, DEFAULT_PRETTIER_OPTIONS, type ESLintConfig, type ESLintParser, type ESLintParserOptions, type ESLintProcessor, type ESLintRuleSeverity, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PINIA_STORE, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_TYPES, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsExtensions, type OptionsFeatures, type OptionsFiles, type OptionsOverrides, type PrettierOptions, type Pretty, type ResolvedOptions, type RuleOptions, type TSESLintParserOptions, type TypedConfigItem, antfu, command, comments, defineESLintConfig, esX, format, getOverrides, githubAction, gitignore, hasPinia, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, importX, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, mergePrettierOptions, node, ntnyq, parserPlain, parserTypeScript, perfectionist, pinia, prettier, regexp, resolveSubOptions, sort, specials, stylistic, test, toArray, toml, typescript, unicorn, unocss, unusedImports, vitest, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -39,23 +39,24 @@ import { default as default3 } from "eslint-plugin-vue";
|
|
|
39
39
|
import { default as default4 } from "eslint-plugin-es-x";
|
|
40
40
|
import { default as default5 } from "eslint-plugin-yml";
|
|
41
41
|
import { default as default6 } from "eslint-plugin-toml";
|
|
42
|
-
import { default as default7 } from "eslint-plugin-
|
|
43
|
-
import { default as default8 } from "
|
|
44
|
-
import { default as default9 } from "eslint
|
|
45
|
-
import { default as default10 } from "eslint-plugin-
|
|
46
|
-
import { default as default11 } from "eslint-plugin-
|
|
42
|
+
import { default as default7 } from "eslint-plugin-pinia";
|
|
43
|
+
import { default as default8 } from "eslint-plugin-ntnyq";
|
|
44
|
+
import { default as default9 } from "@eslint/markdown";
|
|
45
|
+
import { default as default10 } from "eslint-plugin-antfu";
|
|
46
|
+
import { default as default11 } from "eslint-plugin-jsdoc";
|
|
47
|
+
import { default as default12 } from "eslint-plugin-jsonc";
|
|
47
48
|
import { plugin } from "typescript-eslint";
|
|
48
|
-
import { default as
|
|
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
|
|
49
|
+
import { default as default13 } from "eslint-plugin-format";
|
|
50
|
+
import { default as default14 } from "@unocss/eslint-plugin";
|
|
51
|
+
import { default as default15 } from "@vitest/eslint-plugin";
|
|
52
|
+
import { default as default16 } from "eslint-plugin-unicorn";
|
|
53
|
+
import { default as default17 } from "eslint-plugin-import-x";
|
|
54
|
+
import { default as default18 } from "eslint-plugin-prettier";
|
|
55
|
+
import { default as default19 } from "@stylistic/eslint-plugin";
|
|
56
|
+
import { default as default20 } from "eslint-plugin-github-action";
|
|
57
|
+
import { default as default21 } from "eslint-plugin-perfectionist";
|
|
58
|
+
import { default as default22 } from "eslint-plugin-unused-imports";
|
|
59
|
+
import { default as default23 } from "@eslint-community/eslint-plugin-eslint-comments";
|
|
59
60
|
|
|
60
61
|
// src/eslint/configs.ts
|
|
61
62
|
import { configs } from "typescript-eslint";
|
|
@@ -63,7 +64,7 @@ import { configs } from "typescript-eslint";
|
|
|
63
64
|
// src/eslint/processors.ts
|
|
64
65
|
import { mergeProcessors } from "eslint-merge-processors";
|
|
65
66
|
import { processorPassThrough } from "eslint-merge-processors";
|
|
66
|
-
import { default as
|
|
67
|
+
import { default as default24 } from "eslint-processor-vue-blocks";
|
|
67
68
|
|
|
68
69
|
// src/globs.ts
|
|
69
70
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
@@ -109,6 +110,7 @@ var GLOB_ALL_SRC = [
|
|
|
109
110
|
GLOB_HTML,
|
|
110
111
|
GLOB_MARKDOWN
|
|
111
112
|
];
|
|
113
|
+
var GLOB_PINIA_STORE = `**/store?(s)/*.${GLOB_SRC_EXT}`;
|
|
112
114
|
var GLOB_GITHUB_ACTION = "**/.github/workflows/*.y?(a)ml";
|
|
113
115
|
var GLOB_NODE_MODULES = "**/node_modules/**";
|
|
114
116
|
var GLOB_DIST = "**/dist/**";
|
|
@@ -372,7 +374,7 @@ var vue = (options = {}) => {
|
|
|
372
374
|
if (!sfcBlocks) return processorVueSFC;
|
|
373
375
|
return mergeProcessors2([
|
|
374
376
|
processorVueSFC,
|
|
375
|
-
|
|
377
|
+
default24({
|
|
376
378
|
...sfcBlocks,
|
|
377
379
|
blocks: {
|
|
378
380
|
styles: true,
|
|
@@ -971,11 +973,11 @@ var vitest = (options = {}) => [
|
|
|
971
973
|
{
|
|
972
974
|
name: "ntnyq/vitest",
|
|
973
975
|
plugins: {
|
|
974
|
-
vitest:
|
|
976
|
+
vitest: default15
|
|
975
977
|
},
|
|
976
978
|
files: [...GLOB_TEST],
|
|
977
979
|
rules: {
|
|
978
|
-
...
|
|
980
|
+
...default15.configs.recommended.rules,
|
|
979
981
|
// Overrides rules
|
|
980
982
|
...options.overridesVitestRules
|
|
981
983
|
}
|
|
@@ -987,7 +989,7 @@ var antfu = (options = {}) => [
|
|
|
987
989
|
{
|
|
988
990
|
name: "ntnyq/antfu",
|
|
989
991
|
plugins: {
|
|
990
|
-
antfu:
|
|
992
|
+
antfu: default10
|
|
991
993
|
},
|
|
992
994
|
rules: {
|
|
993
995
|
// required `object-curly-newline` to be disabled
|
|
@@ -1014,7 +1016,7 @@ var jsdoc = (options = {}) => [
|
|
|
1014
1016
|
{
|
|
1015
1017
|
name: "ntnyq/jsdoc",
|
|
1016
1018
|
plugins: {
|
|
1017
|
-
jsdoc:
|
|
1019
|
+
jsdoc: default11
|
|
1018
1020
|
},
|
|
1019
1021
|
rules: {
|
|
1020
1022
|
// Disabled rules
|
|
@@ -1043,7 +1045,12 @@ var jsdoc = (options = {}) => [
|
|
|
1043
1045
|
definedTags: [
|
|
1044
1046
|
// magic-comments
|
|
1045
1047
|
"vite-ignore",
|
|
1046
|
-
"unocss-include"
|
|
1048
|
+
"unocss-include",
|
|
1049
|
+
// non-standard, but common used
|
|
1050
|
+
"compatibility",
|
|
1051
|
+
"category",
|
|
1052
|
+
"experimental",
|
|
1053
|
+
"internal"
|
|
1047
1054
|
]
|
|
1048
1055
|
}
|
|
1049
1056
|
],
|
|
@@ -1236,13 +1243,13 @@ var jsonc = (options = {}) => [
|
|
|
1236
1243
|
name: "ntnyq/jsonc",
|
|
1237
1244
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
1238
1245
|
plugins: {
|
|
1239
|
-
jsonc:
|
|
1246
|
+
jsonc: default12
|
|
1240
1247
|
},
|
|
1241
1248
|
languageOptions: {
|
|
1242
1249
|
parser: parserJsonc
|
|
1243
1250
|
},
|
|
1244
1251
|
rules: {
|
|
1245
|
-
...
|
|
1252
|
+
...default12.configs["recommended-with-jsonc"].rules,
|
|
1246
1253
|
"jsonc/no-octal-escape": "error",
|
|
1247
1254
|
"jsonc/indent": ["error", 2],
|
|
1248
1255
|
"jsonc/comma-style": ["error", "last"],
|
|
@@ -1275,12 +1282,43 @@ var jsonc = (options = {}) => [
|
|
|
1275
1282
|
}
|
|
1276
1283
|
];
|
|
1277
1284
|
|
|
1285
|
+
// src/configs/pinia.ts
|
|
1286
|
+
var pinia = (options = {}) => {
|
|
1287
|
+
const { files = [GLOB_PINIA_STORE] } = options;
|
|
1288
|
+
return [
|
|
1289
|
+
{
|
|
1290
|
+
name: "ntnyq/pinia",
|
|
1291
|
+
files,
|
|
1292
|
+
plugins: {
|
|
1293
|
+
pinia: default7
|
|
1294
|
+
},
|
|
1295
|
+
rules: {
|
|
1296
|
+
"pinia/prefer-single-store-per-file": "error",
|
|
1297
|
+
"pinia/no-duplicate-store-ids": "error",
|
|
1298
|
+
"pinia/no-return-global-properties": "error",
|
|
1299
|
+
"pinia/no-store-to-refs-in-store": "error",
|
|
1300
|
+
"pinia/never-export-initialized-store": "error",
|
|
1301
|
+
"pinia/require-setup-store-properties-export": "error",
|
|
1302
|
+
"pinia/prefer-use-store-naming-convention": [
|
|
1303
|
+
"error",
|
|
1304
|
+
{
|
|
1305
|
+
checkStoreNameMismatch: true,
|
|
1306
|
+
storeSuffix: "Store"
|
|
1307
|
+
}
|
|
1308
|
+
],
|
|
1309
|
+
// Overrides rules
|
|
1310
|
+
...options.overrides
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
];
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1278
1316
|
// src/configs/ntnyq.ts
|
|
1279
1317
|
var ntnyq = (options = {}) => [
|
|
1280
1318
|
{
|
|
1281
1319
|
name: "ntnyq/ntnyq",
|
|
1282
1320
|
plugins: {
|
|
1283
|
-
ntnyq:
|
|
1321
|
+
ntnyq: default8
|
|
1284
1322
|
},
|
|
1285
1323
|
rules: {
|
|
1286
1324
|
"ntnyq/no-member-accessibility": "error",
|
|
@@ -1296,7 +1334,7 @@ var regexp = (options = {}) => {
|
|
|
1296
1334
|
const recommendedRules2 = {
|
|
1297
1335
|
...recommendedConfig.rules
|
|
1298
1336
|
};
|
|
1299
|
-
if (options.level === "warn") {
|
|
1337
|
+
if (options.severity || options.level === "warn") {
|
|
1300
1338
|
for (const key in recommendedRules2) {
|
|
1301
1339
|
if (recommendedRules2[key] === "error") {
|
|
1302
1340
|
recommendedRules2[key] = "warn";
|
|
@@ -1321,7 +1359,7 @@ var unocss = (options = {}) => [
|
|
|
1321
1359
|
{
|
|
1322
1360
|
name: "ntnyq/unocss",
|
|
1323
1361
|
plugins: {
|
|
1324
|
-
unocss:
|
|
1362
|
+
unocss: default14
|
|
1325
1363
|
},
|
|
1326
1364
|
rules: {
|
|
1327
1365
|
"unocss/order": "error",
|
|
@@ -1390,6 +1428,7 @@ var hasVitest = isPackageExists("vitest");
|
|
|
1390
1428
|
var hasVue = isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli") || isPackageExists("vue", {
|
|
1391
1429
|
paths: [resolve(process.cwd(), "playground")]
|
|
1392
1430
|
});
|
|
1431
|
+
var hasPinia = isPackageExists("pinia");
|
|
1393
1432
|
var hasUnoCSS = isPackageExists("unocss") || isPackageExists("@unocss/postcss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
|
|
1394
1433
|
|
|
1395
1434
|
// src/utils/toArray.ts
|
|
@@ -1455,7 +1494,7 @@ var format = (options = {}) => {
|
|
|
1455
1494
|
{
|
|
1456
1495
|
name: "ntnyq/format/setup",
|
|
1457
1496
|
plugins: {
|
|
1458
|
-
format:
|
|
1497
|
+
format: default13
|
|
1459
1498
|
}
|
|
1460
1499
|
}
|
|
1461
1500
|
];
|
|
@@ -1554,7 +1593,7 @@ var importX = (options = {}) => [
|
|
|
1554
1593
|
{
|
|
1555
1594
|
name: "ntnyq/import-x",
|
|
1556
1595
|
plugins: {
|
|
1557
|
-
"import-x":
|
|
1596
|
+
"import-x": default17
|
|
1558
1597
|
},
|
|
1559
1598
|
settings: {
|
|
1560
1599
|
"import-x/resolver": {
|
|
@@ -1595,7 +1634,7 @@ var unicorn = (options = {}) => [
|
|
|
1595
1634
|
{
|
|
1596
1635
|
name: "ntnyq/unicorn",
|
|
1597
1636
|
plugins: {
|
|
1598
|
-
unicorn:
|
|
1637
|
+
unicorn: default16
|
|
1599
1638
|
},
|
|
1600
1639
|
rules: {
|
|
1601
1640
|
"unicorn/escape-case": "error",
|
|
@@ -1717,8 +1756,8 @@ var specials = (options = {}) => [
|
|
|
1717
1756
|
name: "ntnyq/specials/config-file",
|
|
1718
1757
|
files: [`**/*.config*.${GLOB_SRC_EXT}`],
|
|
1719
1758
|
plugins: {
|
|
1720
|
-
"import-x":
|
|
1721
|
-
perfectionist:
|
|
1759
|
+
"import-x": default17,
|
|
1760
|
+
perfectionist: default21
|
|
1722
1761
|
},
|
|
1723
1762
|
rules: {
|
|
1724
1763
|
"no-console": "off",
|
|
@@ -1744,10 +1783,10 @@ var comments = (options = {}) => [
|
|
|
1744
1783
|
{
|
|
1745
1784
|
name: "ntnyq/eslint-comments",
|
|
1746
1785
|
plugins: {
|
|
1747
|
-
"@eslint-community/eslint-comments":
|
|
1786
|
+
"@eslint-community/eslint-comments": default23
|
|
1748
1787
|
},
|
|
1749
1788
|
rules: {
|
|
1750
|
-
...
|
|
1789
|
+
...default23.configs.recommended.rules,
|
|
1751
1790
|
"@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
|
|
1752
1791
|
// Overrides rules
|
|
1753
1792
|
...options.overrides
|
|
@@ -1757,10 +1796,10 @@ var comments = (options = {}) => [
|
|
|
1757
1796
|
|
|
1758
1797
|
// src/configs/markdown.ts
|
|
1759
1798
|
var markdown = (options = {}) => {
|
|
1760
|
-
if (!Array.isArray(
|
|
1799
|
+
if (!Array.isArray(default9.configs?.processor)) return [];
|
|
1761
1800
|
const { files = [`${GLOB_MARKDOWN}/${GLOB_SRC}`], extensions = [] } = options;
|
|
1762
1801
|
return [
|
|
1763
|
-
...
|
|
1802
|
+
...default9.configs.processor.map((config) => ({
|
|
1764
1803
|
...config,
|
|
1765
1804
|
name: `ntnyq/${config.name}`
|
|
1766
1805
|
})),
|
|
@@ -1769,7 +1808,7 @@ var markdown = (options = {}) => {
|
|
|
1769
1808
|
files,
|
|
1770
1809
|
ignores: [GLOB_MARKDOWN_NESTED],
|
|
1771
1810
|
processor: mergeProcessors([
|
|
1772
|
-
|
|
1811
|
+
default9.processors.markdown,
|
|
1773
1812
|
// Just pass through processor
|
|
1774
1813
|
processorPassThrough
|
|
1775
1814
|
])
|
|
@@ -1834,7 +1873,7 @@ var prettier = (options = {}) => {
|
|
|
1834
1873
|
{
|
|
1835
1874
|
name: "ntnyq/prettier",
|
|
1836
1875
|
plugins: {
|
|
1837
|
-
prettier:
|
|
1876
|
+
prettier: default18
|
|
1838
1877
|
},
|
|
1839
1878
|
rules: {
|
|
1840
1879
|
"vue/array-bracket-newline": "off",
|
|
@@ -1874,8 +1913,8 @@ var prettier = (options = {}) => {
|
|
|
1874
1913
|
"vue/space-infix-ops": "off",
|
|
1875
1914
|
"vue/space-unary-ops": "off",
|
|
1876
1915
|
"vue/template-curly-spacing": "off",
|
|
1877
|
-
...
|
|
1878
|
-
"prettier/prettier": options.level || "warn",
|
|
1916
|
+
...default18.configs.recommended.rules,
|
|
1917
|
+
"prettier/prettier": options.severity || options.level || "warn",
|
|
1879
1918
|
// Overrides rules
|
|
1880
1919
|
...options.overrides
|
|
1881
1920
|
}
|
|
@@ -1887,7 +1926,7 @@ var prettier = (options = {}) => {
|
|
|
1887
1926
|
name: "ntnyq/prettier/disabled",
|
|
1888
1927
|
files: [...disabledFiles, ...userDisabledFiles],
|
|
1889
1928
|
plugins: {
|
|
1890
|
-
prettier:
|
|
1929
|
+
prettier: default18
|
|
1891
1930
|
},
|
|
1892
1931
|
rules: {
|
|
1893
1932
|
"prettier/prettier": "off"
|
|
@@ -1901,7 +1940,7 @@ var stylistic = (options = {}) => [
|
|
|
1901
1940
|
{
|
|
1902
1941
|
name: "ntnyq/stylistic",
|
|
1903
1942
|
plugins: {
|
|
1904
|
-
"@stylistic":
|
|
1943
|
+
"@stylistic": default19
|
|
1905
1944
|
},
|
|
1906
1945
|
rules: {
|
|
1907
1946
|
// Only rules are not conflicted with Prettier
|
|
@@ -2235,7 +2274,7 @@ var typescript = (options = {}) => {
|
|
|
2235
2274
|
name: "ntnyq/ts/setup",
|
|
2236
2275
|
plugins: {
|
|
2237
2276
|
"@typescript-eslint": plugin,
|
|
2238
|
-
antfu:
|
|
2277
|
+
antfu: default10
|
|
2239
2278
|
}
|
|
2240
2279
|
},
|
|
2241
2280
|
...enableTypeAwareLint ? [
|
|
@@ -2459,7 +2498,7 @@ var perfectionist = (options = {}) => {
|
|
|
2459
2498
|
{
|
|
2460
2499
|
name: "ntnyq/perfectionist/common",
|
|
2461
2500
|
plugins: {
|
|
2462
|
-
perfectionist:
|
|
2501
|
+
perfectionist: default21
|
|
2463
2502
|
},
|
|
2464
2503
|
rules: {
|
|
2465
2504
|
"perfectionist/sort-imports": [
|
|
@@ -2544,7 +2583,7 @@ var perfectionist = (options = {}) => {
|
|
|
2544
2583
|
name: "ntnyq/perfectionist/enums",
|
|
2545
2584
|
files: [`**/enums/${GLOB_SRC}`, `**/enums.${GLOB_SRC_EXT}`],
|
|
2546
2585
|
plugins: {
|
|
2547
|
-
perfectionist:
|
|
2586
|
+
perfectionist: default21
|
|
2548
2587
|
},
|
|
2549
2588
|
rules: {
|
|
2550
2589
|
"perfectionist/sort-enums": [
|
|
@@ -2573,7 +2612,7 @@ var perfectionist = (options = {}) => {
|
|
|
2573
2612
|
name: "ntnyq/perfectionist/types",
|
|
2574
2613
|
files: [...GLOB_TYPES],
|
|
2575
2614
|
plugins: {
|
|
2576
|
-
perfectionist:
|
|
2615
|
+
perfectionist: default21
|
|
2577
2616
|
},
|
|
2578
2617
|
rules: {
|
|
2579
2618
|
"perfectionist/sort-heritage-clauses": [
|
|
@@ -2637,7 +2676,7 @@ var perfectionist = (options = {}) => {
|
|
|
2637
2676
|
name: "ntnyq/perfectionist/constants",
|
|
2638
2677
|
files: [`**/constants/${GLOB_SRC}`, `**/constants.${GLOB_SRC_EXT}`],
|
|
2639
2678
|
plugins: {
|
|
2640
|
-
perfectionist:
|
|
2679
|
+
perfectionist: default21
|
|
2641
2680
|
},
|
|
2642
2681
|
rules: {
|
|
2643
2682
|
"perfectionist/sort-maps": [
|
|
@@ -2653,7 +2692,8 @@ var perfectionist = (options = {}) => {
|
|
|
2653
2692
|
{
|
|
2654
2693
|
type: "alphabetical",
|
|
2655
2694
|
order: "asc",
|
|
2656
|
-
partitionByComment: true
|
|
2695
|
+
partitionByComment: true,
|
|
2696
|
+
groups: ["unknown", "method", "multiline"]
|
|
2657
2697
|
}
|
|
2658
2698
|
],
|
|
2659
2699
|
"perfectionist/sort-sets": [
|
|
@@ -2685,7 +2725,7 @@ var unusedImports = (options = {}) => [
|
|
|
2685
2725
|
{
|
|
2686
2726
|
name: "ntnyq/unused-imports",
|
|
2687
2727
|
plugins: {
|
|
2688
|
-
"unused-imports":
|
|
2728
|
+
"unused-imports": default22
|
|
2689
2729
|
},
|
|
2690
2730
|
rules: {
|
|
2691
2731
|
"@typescript-eslint/no-unused-vars": "off",
|
|
@@ -2720,6 +2760,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2720
2760
|
* Conditional by deps
|
|
2721
2761
|
*/
|
|
2722
2762
|
vue: enableVue = hasVue,
|
|
2763
|
+
pinia: enablePinia = hasPinia,
|
|
2723
2764
|
test: enableTest = hasVitest,
|
|
2724
2765
|
unocss: enableUnoCSS = hasUnoCSS,
|
|
2725
2766
|
typescript: enableTypeScript = hasTypeScript,
|
|
@@ -2790,6 +2831,14 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2790
2831
|
})
|
|
2791
2832
|
);
|
|
2792
2833
|
}
|
|
2834
|
+
if (enablePinia) {
|
|
2835
|
+
configs2.push(
|
|
2836
|
+
...pinia({
|
|
2837
|
+
...resolveSubOptions(options, "pinia"),
|
|
2838
|
+
overrides: getOverrides(options, "pinia")
|
|
2839
|
+
})
|
|
2840
|
+
);
|
|
2841
|
+
}
|
|
2793
2842
|
if (enableRegexp) {
|
|
2794
2843
|
configs2.push(
|
|
2795
2844
|
...regexp({
|
|
@@ -2927,6 +2976,7 @@ export {
|
|
|
2927
2976
|
GLOB_MARKDOWN_CODE,
|
|
2928
2977
|
GLOB_MARKDOWN_NESTED,
|
|
2929
2978
|
GLOB_NODE_MODULES,
|
|
2979
|
+
GLOB_PINIA_STORE,
|
|
2930
2980
|
GLOB_POSTCSS,
|
|
2931
2981
|
GLOB_SCSS,
|
|
2932
2982
|
GLOB_SRC,
|
|
@@ -2949,6 +2999,7 @@ export {
|
|
|
2949
2999
|
getOverrides,
|
|
2950
3000
|
githubAction,
|
|
2951
3001
|
gitignore,
|
|
3002
|
+
hasPinia,
|
|
2952
3003
|
hasTypeScript,
|
|
2953
3004
|
hasUnoCSS,
|
|
2954
3005
|
hasVitest,
|
|
@@ -2973,32 +3024,34 @@ export {
|
|
|
2973
3024
|
parserVue,
|
|
2974
3025
|
parserYaml,
|
|
2975
3026
|
perfectionist,
|
|
2976
|
-
|
|
2977
|
-
|
|
3027
|
+
pinia,
|
|
3028
|
+
default10 as pluginAntfu,
|
|
3029
|
+
default23 as pluginComments,
|
|
2978
3030
|
default4 as pluginEsX,
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
3031
|
+
default13 as pluginFormat,
|
|
3032
|
+
default20 as pluginGitHubAction,
|
|
3033
|
+
default17 as pluginImportX,
|
|
3034
|
+
default11 as pluginJsdoc,
|
|
3035
|
+
default12 as pluginJsonc,
|
|
3036
|
+
default9 as pluginMarkdown,
|
|
2985
3037
|
default2 as pluginNode,
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
3038
|
+
default8 as pluginNtnyq,
|
|
3039
|
+
default21 as pluginPerfectionist,
|
|
3040
|
+
default7 as pluginPinia,
|
|
3041
|
+
default18 as pluginPrettier,
|
|
2989
3042
|
pluginRegexp,
|
|
2990
|
-
|
|
3043
|
+
default19 as pluginStylistic,
|
|
2991
3044
|
default6 as pluginToml,
|
|
2992
3045
|
plugin as pluginTypeScript,
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
3046
|
+
default16 as pluginUnicorn,
|
|
3047
|
+
default14 as pluginUnoCSS,
|
|
3048
|
+
default22 as pluginUnusedImports,
|
|
3049
|
+
default15 as pluginVitest,
|
|
2997
3050
|
default3 as pluginVue,
|
|
2998
3051
|
default5 as pluginYaml,
|
|
2999
3052
|
prettier,
|
|
3000
3053
|
processorPassThrough,
|
|
3001
|
-
|
|
3054
|
+
default24 as processorVueBlocks,
|
|
3002
3055
|
regexp,
|
|
3003
3056
|
resolveSubOptions,
|
|
3004
3057
|
sort,
|
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.
|
|
4
|
+
"version": "3.9.1",
|
|
5
|
+
"packageManager": "pnpm@9.15.0",
|
|
6
6
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"eslint",
|
|
@@ -60,21 +60,23 @@
|
|
|
60
60
|
"@eslint/js": "^9.16.0",
|
|
61
61
|
"@eslint/markdown": "^6.2.1",
|
|
62
62
|
"@stylistic/eslint-plugin": "^2.11.0",
|
|
63
|
-
"@unocss/eslint-plugin": "^0.65.
|
|
63
|
+
"@unocss/eslint-plugin": "^0.65.1",
|
|
64
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",
|
|
68
68
|
"eslint-plugin-antfu": "^2.7.0",
|
|
69
69
|
"eslint-plugin-command": "^0.2.6",
|
|
70
|
+
"eslint-plugin-es-x": "^8.4.1",
|
|
70
71
|
"eslint-plugin-format": "^0.1.3",
|
|
71
|
-
"eslint-plugin-github-action": "^0.0.
|
|
72
|
+
"eslint-plugin-github-action": "^0.0.11",
|
|
72
73
|
"eslint-plugin-import-x": "^4.5.0",
|
|
73
74
|
"eslint-plugin-jsdoc": "^50.6.0",
|
|
74
75
|
"eslint-plugin-jsonc": "^2.18.2",
|
|
75
76
|
"eslint-plugin-n": "^17.14.0",
|
|
76
77
|
"eslint-plugin-ntnyq": "^0.7.1",
|
|
77
78
|
"eslint-plugin-perfectionist": "^4.2.0",
|
|
79
|
+
"eslint-plugin-pinia": "^0.4.1",
|
|
78
80
|
"eslint-plugin-prettier": "^5.2.1",
|
|
79
81
|
"eslint-plugin-regexp": "^2.7.0",
|
|
80
82
|
"eslint-plugin-toml": "^0.12.0",
|
|
@@ -86,7 +88,7 @@
|
|
|
86
88
|
"globals": "^15.13.0",
|
|
87
89
|
"jsonc-eslint-parser": "^2.4.0",
|
|
88
90
|
"local-pkg": "^0.5.1",
|
|
89
|
-
"prettier": "^3.4.
|
|
91
|
+
"prettier": "^3.4.2",
|
|
90
92
|
"toml-eslint-parser": "^0.10.0",
|
|
91
93
|
"typescript-eslint": "^8.17.0",
|
|
92
94
|
"vue-eslint-parser": "^9.4.3",
|
|
@@ -97,7 +99,6 @@
|
|
|
97
99
|
"@types/node": "^22.10.1",
|
|
98
100
|
"bumpp": "^9.8.1",
|
|
99
101
|
"eslint": "^9.16.0",
|
|
100
|
-
"eslint-plugin-es-x": "^8.4.1",
|
|
101
102
|
"eslint-typegen": "^0.3.2",
|
|
102
103
|
"husky": "^9.1.7",
|
|
103
104
|
"jiti": "^2.4.1",
|
|
@@ -118,7 +119,6 @@
|
|
|
118
119
|
"@vitest/eslint-plugin": "patches/@vitest__eslint-plugin.patch"
|
|
119
120
|
}
|
|
120
121
|
},
|
|
121
|
-
"prettier": "@ntnyq/prettier-config",
|
|
122
122
|
"nano-staged": {
|
|
123
123
|
"*.{js,ts,mjs,cjs,json,jsonc,md,yaml,yml}": "eslint --flag unstable_ts_config --fix"
|
|
124
124
|
}
|