@dhzh/eslint-config 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +34 -34
- package/dist/cli.js +34 -34
- package/dist/index.cjs +7 -3
- package/dist/index.d.cts +474 -322
- package/dist/index.d.ts +474 -322
- package/dist/index.js +6 -3
- package/package.json +24 -24
package/dist/cli.cjs
CHANGED
|
@@ -48,8 +48,8 @@ var import_picocolors = __toESM(require("picocolors"), 1);
|
|
|
48
48
|
var package_default = {
|
|
49
49
|
name: "@dhzh/eslint-config",
|
|
50
50
|
type: "module",
|
|
51
|
-
version: "0.
|
|
52
|
-
packageManager: "pnpm@9.
|
|
51
|
+
version: "0.12.0",
|
|
52
|
+
packageManager: "pnpm@9.6.0",
|
|
53
53
|
description: "Easton's ESLint config",
|
|
54
54
|
author: "Easton Zheng <dhzhme@gmail.com>",
|
|
55
55
|
license: "MIT",
|
|
@@ -131,31 +131,31 @@ var package_default = {
|
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
133
|
dependencies: {
|
|
134
|
-
"@antfu/eslint-plugin-unused-imports": "^4.0.0",
|
|
135
134
|
"@antfu/install-pkg": "^0.3.3",
|
|
136
135
|
"@clack/prompts": "^0.7.0",
|
|
137
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
138
|
-
"@stylistic/eslint-plugin": "^2.6.0-beta.
|
|
136
|
+
"@eslint-react/eslint-plugin": "^1.6.0",
|
|
137
|
+
"@stylistic/eslint-plugin": "^2.6.0-beta.1",
|
|
139
138
|
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.40",
|
|
140
139
|
"@typescript-eslint/parser": "8.0.0-alpha.40",
|
|
141
140
|
"eslint-config-flat-gitignore": "^0.1.8",
|
|
142
|
-
"eslint-flat-config-utils": "^0.
|
|
141
|
+
"eslint-flat-config-utils": "^0.3.0",
|
|
143
142
|
"eslint-merge-processors": "^0.1.0",
|
|
144
143
|
"eslint-plugin-antfu": "^2.3.4",
|
|
145
144
|
"eslint-plugin-command": "^0.2.3",
|
|
146
145
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
147
|
-
"eslint-plugin-import-x": "^3.0
|
|
148
|
-
"eslint-plugin-jsdoc": "^48.
|
|
146
|
+
"eslint-plugin-import-x": "^3.1.0",
|
|
147
|
+
"eslint-plugin-jsdoc": "^48.8.3",
|
|
149
148
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
150
149
|
"eslint-plugin-markdown": "^5.1.0",
|
|
151
|
-
"eslint-plugin-n": "^17.
|
|
150
|
+
"eslint-plugin-n": "^17.10.1",
|
|
152
151
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
153
|
-
"eslint-plugin-perfectionist": "^
|
|
152
|
+
"eslint-plugin-perfectionist": "^3.0.0",
|
|
154
153
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
155
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
154
|
+
"eslint-plugin-react-refresh": "^0.4.9",
|
|
156
155
|
"eslint-plugin-regexp": "^2.6.0",
|
|
157
156
|
"eslint-plugin-toml": "^0.11.1",
|
|
158
|
-
"eslint-plugin-unicorn": "^
|
|
157
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
158
|
+
"eslint-plugin-unused-imports": "^4.0.1",
|
|
159
159
|
"eslint-plugin-vitest": "^0.5.4",
|
|
160
160
|
"eslint-plugin-vue": "^9.27.0",
|
|
161
161
|
"eslint-plugin-yml": "^1.14.0",
|
|
@@ -173,15 +173,15 @@ var package_default = {
|
|
|
173
173
|
devDependencies: {
|
|
174
174
|
"@antfu/ni": "^0.22.0",
|
|
175
175
|
"@dhzh/eslint-config": "workspace:*",
|
|
176
|
-
"@eslint/config-inspector": "^0.5.
|
|
176
|
+
"@eslint/config-inspector": "^0.5.2",
|
|
177
177
|
"@prettier/plugin-xml": "^3.4.1",
|
|
178
|
-
"@stylistic/eslint-plugin-migrate": "^2.
|
|
179
|
-
"@types/eslint": "^
|
|
178
|
+
"@stylistic/eslint-plugin-migrate": "^2.4.0",
|
|
179
|
+
"@types/eslint": "^9.6.0",
|
|
180
180
|
"@types/fs-extra": "^11.0.4",
|
|
181
|
-
"@types/node": "^20.14.
|
|
181
|
+
"@types/node": "^20.14.12",
|
|
182
182
|
"@types/prompts": "^2.4.9",
|
|
183
183
|
"@types/yargs": "^17.0.32",
|
|
184
|
-
"@unocss/eslint-plugin": "^0.61.
|
|
184
|
+
"@unocss/eslint-plugin": "^0.61.6",
|
|
185
185
|
"astro-eslint-parser": "^1.0.2",
|
|
186
186
|
bumpp: "^9.4.1",
|
|
187
187
|
"bundle-require": "^5.0.0",
|
|
@@ -189,9 +189,9 @@ var package_default = {
|
|
|
189
189
|
"eslint-plugin-astro": "^1.2.3",
|
|
190
190
|
"eslint-plugin-format": "^0.1.2",
|
|
191
191
|
"eslint-plugin-solid": "^0.14.1",
|
|
192
|
-
"eslint-plugin-svelte": "^2.
|
|
192
|
+
"eslint-plugin-svelte": "^2.43.0",
|
|
193
193
|
"eslint-ts-patch": "9.5.0-0",
|
|
194
|
-
"eslint-typegen": "^0.
|
|
194
|
+
"eslint-typegen": "^0.3.0",
|
|
195
195
|
esno: "^4.7.0",
|
|
196
196
|
execa: "^9.3.0",
|
|
197
197
|
"fast-glob": "^3.3.2",
|
|
@@ -202,12 +202,12 @@ var package_default = {
|
|
|
202
202
|
rimraf: "^6.0.1",
|
|
203
203
|
"simple-git-hooks": "^2.11.1",
|
|
204
204
|
svelte: "^4.2.18",
|
|
205
|
-
"svelte-eslint-parser": "^0.
|
|
206
|
-
tsup: "^8.
|
|
205
|
+
"svelte-eslint-parser": "^0.41.0",
|
|
206
|
+
tsup: "^8.2.3",
|
|
207
207
|
tsx: "^4.16.2",
|
|
208
|
-
typescript: "^5.5.
|
|
209
|
-
vitest: "^2.0.
|
|
210
|
-
vue: "^3.4.
|
|
208
|
+
typescript: "^5.5.4",
|
|
209
|
+
vitest: "^2.0.4",
|
|
210
|
+
vue: "^3.4.34"
|
|
211
211
|
},
|
|
212
212
|
resolutions: {
|
|
213
213
|
tsx: "~4.16.2"
|
|
@@ -239,16 +239,16 @@ var vscodeSettingsString = `
|
|
|
239
239
|
|
|
240
240
|
// Silent the stylistic rules in you IDE, but still auto fix them
|
|
241
241
|
// "eslint.rules.customizations": [
|
|
242
|
-
// { "rule": "style/*", "severity": "off" },
|
|
243
|
-
// { "rule": "format/*", "severity": "off" },
|
|
244
|
-
// { "rule": "*-indent", "severity": "off" },
|
|
245
|
-
// { "rule": "*-spacing", "severity": "off" },
|
|
246
|
-
// { "rule": "*-spaces", "severity": "off" },
|
|
247
|
-
// { "rule": "*-order", "severity": "off" },
|
|
248
|
-
// { "rule": "*-dangle", "severity": "off" },
|
|
249
|
-
// { "rule": "*-newline", "severity": "off" },
|
|
250
|
-
// { "rule": "*quotes", "severity": "off" },
|
|
251
|
-
// { "rule": "*semi", "severity": "off" }
|
|
242
|
+
// { "rule": "style/*", "severity": "off", "fixable": true },
|
|
243
|
+
// { "rule": "format/*", "severity": "off", "fixable": true },
|
|
244
|
+
// { "rule": "*-indent", "severity": "off", "fixable": true },
|
|
245
|
+
// { "rule": "*-spacing", "severity": "off", "fixable": true },
|
|
246
|
+
// { "rule": "*-spaces", "severity": "off", "fixable": true },
|
|
247
|
+
// { "rule": "*-order", "severity": "off", "fixable": true },
|
|
248
|
+
// { "rule": "*-dangle", "severity": "off", "fixable": true },
|
|
249
|
+
// { "rule": "*-newline", "severity": "off", "fixable": true },
|
|
250
|
+
// { "rule": "*quotes", "severity": "off", "fixable": true },
|
|
251
|
+
// { "rule": "*semi", "severity": "off", "fixable": true }
|
|
252
252
|
// ],
|
|
253
253
|
|
|
254
254
|
// Enable eslint for all supported languages
|
package/dist/cli.js
CHANGED
|
@@ -19,8 +19,8 @@ import c from "picocolors";
|
|
|
19
19
|
var package_default = {
|
|
20
20
|
name: "@dhzh/eslint-config",
|
|
21
21
|
type: "module",
|
|
22
|
-
version: "0.
|
|
23
|
-
packageManager: "pnpm@9.
|
|
22
|
+
version: "0.12.0",
|
|
23
|
+
packageManager: "pnpm@9.6.0",
|
|
24
24
|
description: "Easton's ESLint config",
|
|
25
25
|
author: "Easton Zheng <dhzhme@gmail.com>",
|
|
26
26
|
license: "MIT",
|
|
@@ -102,31 +102,31 @@ var package_default = {
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
dependencies: {
|
|
105
|
-
"@antfu/eslint-plugin-unused-imports": "^4.0.0",
|
|
106
105
|
"@antfu/install-pkg": "^0.3.3",
|
|
107
106
|
"@clack/prompts": "^0.7.0",
|
|
108
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
109
|
-
"@stylistic/eslint-plugin": "^2.6.0-beta.
|
|
107
|
+
"@eslint-react/eslint-plugin": "^1.6.0",
|
|
108
|
+
"@stylistic/eslint-plugin": "^2.6.0-beta.1",
|
|
110
109
|
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.40",
|
|
111
110
|
"@typescript-eslint/parser": "8.0.0-alpha.40",
|
|
112
111
|
"eslint-config-flat-gitignore": "^0.1.8",
|
|
113
|
-
"eslint-flat-config-utils": "^0.
|
|
112
|
+
"eslint-flat-config-utils": "^0.3.0",
|
|
114
113
|
"eslint-merge-processors": "^0.1.0",
|
|
115
114
|
"eslint-plugin-antfu": "^2.3.4",
|
|
116
115
|
"eslint-plugin-command": "^0.2.3",
|
|
117
116
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
118
|
-
"eslint-plugin-import-x": "^3.0
|
|
119
|
-
"eslint-plugin-jsdoc": "^48.
|
|
117
|
+
"eslint-plugin-import-x": "^3.1.0",
|
|
118
|
+
"eslint-plugin-jsdoc": "^48.8.3",
|
|
120
119
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
121
120
|
"eslint-plugin-markdown": "^5.1.0",
|
|
122
|
-
"eslint-plugin-n": "^17.
|
|
121
|
+
"eslint-plugin-n": "^17.10.1",
|
|
123
122
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
124
|
-
"eslint-plugin-perfectionist": "^
|
|
123
|
+
"eslint-plugin-perfectionist": "^3.0.0",
|
|
125
124
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
126
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
125
|
+
"eslint-plugin-react-refresh": "^0.4.9",
|
|
127
126
|
"eslint-plugin-regexp": "^2.6.0",
|
|
128
127
|
"eslint-plugin-toml": "^0.11.1",
|
|
129
|
-
"eslint-plugin-unicorn": "^
|
|
128
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
129
|
+
"eslint-plugin-unused-imports": "^4.0.1",
|
|
130
130
|
"eslint-plugin-vitest": "^0.5.4",
|
|
131
131
|
"eslint-plugin-vue": "^9.27.0",
|
|
132
132
|
"eslint-plugin-yml": "^1.14.0",
|
|
@@ -144,15 +144,15 @@ var package_default = {
|
|
|
144
144
|
devDependencies: {
|
|
145
145
|
"@antfu/ni": "^0.22.0",
|
|
146
146
|
"@dhzh/eslint-config": "workspace:*",
|
|
147
|
-
"@eslint/config-inspector": "^0.5.
|
|
147
|
+
"@eslint/config-inspector": "^0.5.2",
|
|
148
148
|
"@prettier/plugin-xml": "^3.4.1",
|
|
149
|
-
"@stylistic/eslint-plugin-migrate": "^2.
|
|
150
|
-
"@types/eslint": "^
|
|
149
|
+
"@stylistic/eslint-plugin-migrate": "^2.4.0",
|
|
150
|
+
"@types/eslint": "^9.6.0",
|
|
151
151
|
"@types/fs-extra": "^11.0.4",
|
|
152
|
-
"@types/node": "^20.14.
|
|
152
|
+
"@types/node": "^20.14.12",
|
|
153
153
|
"@types/prompts": "^2.4.9",
|
|
154
154
|
"@types/yargs": "^17.0.32",
|
|
155
|
-
"@unocss/eslint-plugin": "^0.61.
|
|
155
|
+
"@unocss/eslint-plugin": "^0.61.6",
|
|
156
156
|
"astro-eslint-parser": "^1.0.2",
|
|
157
157
|
bumpp: "^9.4.1",
|
|
158
158
|
"bundle-require": "^5.0.0",
|
|
@@ -160,9 +160,9 @@ var package_default = {
|
|
|
160
160
|
"eslint-plugin-astro": "^1.2.3",
|
|
161
161
|
"eslint-plugin-format": "^0.1.2",
|
|
162
162
|
"eslint-plugin-solid": "^0.14.1",
|
|
163
|
-
"eslint-plugin-svelte": "^2.
|
|
163
|
+
"eslint-plugin-svelte": "^2.43.0",
|
|
164
164
|
"eslint-ts-patch": "9.5.0-0",
|
|
165
|
-
"eslint-typegen": "^0.
|
|
165
|
+
"eslint-typegen": "^0.3.0",
|
|
166
166
|
esno: "^4.7.0",
|
|
167
167
|
execa: "^9.3.0",
|
|
168
168
|
"fast-glob": "^3.3.2",
|
|
@@ -173,12 +173,12 @@ var package_default = {
|
|
|
173
173
|
rimraf: "^6.0.1",
|
|
174
174
|
"simple-git-hooks": "^2.11.1",
|
|
175
175
|
svelte: "^4.2.18",
|
|
176
|
-
"svelte-eslint-parser": "^0.
|
|
177
|
-
tsup: "^8.
|
|
176
|
+
"svelte-eslint-parser": "^0.41.0",
|
|
177
|
+
tsup: "^8.2.3",
|
|
178
178
|
tsx: "^4.16.2",
|
|
179
|
-
typescript: "^5.5.
|
|
180
|
-
vitest: "^2.0.
|
|
181
|
-
vue: "^3.4.
|
|
179
|
+
typescript: "^5.5.4",
|
|
180
|
+
vitest: "^2.0.4",
|
|
181
|
+
vue: "^3.4.34"
|
|
182
182
|
},
|
|
183
183
|
resolutions: {
|
|
184
184
|
tsx: "~4.16.2"
|
|
@@ -210,16 +210,16 @@ var vscodeSettingsString = `
|
|
|
210
210
|
|
|
211
211
|
// Silent the stylistic rules in you IDE, but still auto fix them
|
|
212
212
|
// "eslint.rules.customizations": [
|
|
213
|
-
// { "rule": "style/*", "severity": "off" },
|
|
214
|
-
// { "rule": "format/*", "severity": "off" },
|
|
215
|
-
// { "rule": "*-indent", "severity": "off" },
|
|
216
|
-
// { "rule": "*-spacing", "severity": "off" },
|
|
217
|
-
// { "rule": "*-spaces", "severity": "off" },
|
|
218
|
-
// { "rule": "*-order", "severity": "off" },
|
|
219
|
-
// { "rule": "*-dangle", "severity": "off" },
|
|
220
|
-
// { "rule": "*-newline", "severity": "off" },
|
|
221
|
-
// { "rule": "*quotes", "severity": "off" },
|
|
222
|
-
// { "rule": "*semi", "severity": "off" }
|
|
213
|
+
// { "rule": "style/*", "severity": "off", "fixable": true },
|
|
214
|
+
// { "rule": "format/*", "severity": "off", "fixable": true },
|
|
215
|
+
// { "rule": "*-indent", "severity": "off", "fixable": true },
|
|
216
|
+
// { "rule": "*-spacing", "severity": "off", "fixable": true },
|
|
217
|
+
// { "rule": "*-spaces", "severity": "off", "fixable": true },
|
|
218
|
+
// { "rule": "*-order", "severity": "off", "fixable": true },
|
|
219
|
+
// { "rule": "*-dangle", "severity": "off", "fixable": true },
|
|
220
|
+
// { "rule": "*-newline", "severity": "off", "fixable": true },
|
|
221
|
+
// { "rule": "*quotes", "severity": "off", "fixable": true },
|
|
222
|
+
// { "rule": "*semi", "severity": "off", "fixable": true }
|
|
223
223
|
// ],
|
|
224
224
|
|
|
225
225
|
// Enable eslint for all supported languages
|
package/dist/index.cjs
CHANGED
|
@@ -73,6 +73,7 @@ __export(src_exports, {
|
|
|
73
73
|
ignores: () => ignores,
|
|
74
74
|
imports: () => imports,
|
|
75
75
|
interopDefault: () => interopDefault,
|
|
76
|
+
isInEditorEnv: () => isInEditorEnv,
|
|
76
77
|
javascript: () => javascript,
|
|
77
78
|
jsdoc: () => jsdoc,
|
|
78
79
|
jsonc: () => jsonc,
|
|
@@ -103,7 +104,6 @@ __export(src_exports, {
|
|
|
103
104
|
module.exports = __toCommonJS(src_exports);
|
|
104
105
|
|
|
105
106
|
// src/factory.ts
|
|
106
|
-
var import_node_process3 = __toESM(require("process"), 1);
|
|
107
107
|
var import_local_pkg4 = require("local-pkg");
|
|
108
108
|
var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
109
109
|
|
|
@@ -268,6 +268,9 @@ async function ensurePackages(packages) {
|
|
|
268
268
|
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
+
function isInEditorEnv() {
|
|
272
|
+
return !!((import_node_process.default.env.VSCODE_PID || import_node_process.default.env.VSCODE_CWD || import_node_process.default.env.JETBRAINS_IDE || import_node_process.default.env.VIM || import_node_process.default.env.NVIM) && !import_node_process.default.env.CI);
|
|
273
|
+
}
|
|
271
274
|
|
|
272
275
|
// src/configs/astro.ts
|
|
273
276
|
async function astro(options = {}) {
|
|
@@ -347,7 +350,7 @@ var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint
|
|
|
347
350
|
var pluginImport = __toESM(require("eslint-plugin-import-x"), 1);
|
|
348
351
|
var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
|
|
349
352
|
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
350
|
-
var import_eslint_plugin_unused_imports = __toESM(require("
|
|
353
|
+
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
351
354
|
var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
352
355
|
|
|
353
356
|
// src/configs/comments.ts
|
|
@@ -2396,7 +2399,7 @@ function dhzh(options = {}, ...userConfigs) {
|
|
|
2396
2399
|
autoRenamePlugins = true,
|
|
2397
2400
|
componentExts = [],
|
|
2398
2401
|
gitignore: enableGitignore = true,
|
|
2399
|
-
isInEditor =
|
|
2402
|
+
isInEditor = isInEditorEnv(),
|
|
2400
2403
|
jsx: enableJsx = true,
|
|
2401
2404
|
react: enableReact = false,
|
|
2402
2405
|
regexp: enableRegexp = true,
|
|
@@ -2623,6 +2626,7 @@ var src_default = dhzh;
|
|
|
2623
2626
|
ignores,
|
|
2624
2627
|
imports,
|
|
2625
2628
|
interopDefault,
|
|
2629
|
+
isInEditorEnv,
|
|
2626
2630
|
javascript,
|
|
2627
2631
|
jsdoc,
|
|
2628
2632
|
jsonc,
|