@antfu/eslint-config 5.2.2 → 5.4.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.js +10 -13
- package/dist/index.d.ts +336 -220
- package/dist/index.js +5 -9
- package/package.json +21 -21
package/dist/index.js
CHANGED
|
@@ -122,8 +122,7 @@ const parserPlain = {
|
|
|
122
122
|
* Combine array and non-array configs into a single array.
|
|
123
123
|
*/
|
|
124
124
|
async function combine(...configs$1) {
|
|
125
|
-
|
|
126
|
-
return resolved.flat();
|
|
125
|
+
return (await Promise.all(configs$1)).flat();
|
|
127
126
|
}
|
|
128
127
|
/**
|
|
129
128
|
* Rename plugin prefixes in a rule object.
|
|
@@ -188,9 +187,7 @@ async function ensurePackages(packages) {
|
|
|
188
187
|
if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false) return;
|
|
189
188
|
const nonExistingPackages = packages.filter((i) => i && !isPackageInScope(i));
|
|
190
189
|
if (nonExistingPackages.length === 0) return;
|
|
191
|
-
|
|
192
|
-
const result = await p.confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` });
|
|
193
|
-
if (result) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
190
|
+
if (await (await import("@clack/prompts")).confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` })) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
194
191
|
}
|
|
195
192
|
function isInEditorEnv() {
|
|
196
193
|
if (process.env.CI) return false;
|
|
@@ -431,10 +428,9 @@ async function formatters(options = {}, stylistic$1 = {}) {
|
|
|
431
428
|
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
432
429
|
useTabs: indent === "tab"
|
|
433
430
|
}, options.dprintOptions || {});
|
|
434
|
-
const pluginFormat = await interopDefault(import("eslint-plugin-format"));
|
|
435
431
|
const configs$1 = [{
|
|
436
432
|
name: "antfu/formatter/setup",
|
|
437
|
-
plugins: { format:
|
|
433
|
+
plugins: { format: await interopDefault(import("eslint-plugin-format")) }
|
|
438
434
|
}];
|
|
439
435
|
if (options.css) configs$1.push({
|
|
440
436
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
@@ -582,7 +578,7 @@ async function javascript(options = {}) {
|
|
|
582
578
|
const { isInEditor = false, overrides = {} } = options;
|
|
583
579
|
return [{
|
|
584
580
|
languageOptions: {
|
|
585
|
-
ecmaVersion:
|
|
581
|
+
ecmaVersion: "latest",
|
|
586
582
|
globals: {
|
|
587
583
|
...globals.browser,
|
|
588
584
|
...globals.es2021,
|
|
@@ -593,7 +589,7 @@ async function javascript(options = {}) {
|
|
|
593
589
|
},
|
|
594
590
|
parserOptions: {
|
|
595
591
|
ecmaFeatures: { jsx: true },
|
|
596
|
-
ecmaVersion:
|
|
592
|
+
ecmaVersion: "latest",
|
|
597
593
|
sourceType: "module"
|
|
598
594
|
},
|
|
599
595
|
sourceType: "module"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antfu/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.4.0",
|
|
5
5
|
"description": "Anthony's ESLint config",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
"@clack/prompts": "^0.11.0",
|
|
102
102
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
103
103
|
"@eslint/markdown": "^7.2.0",
|
|
104
|
-
"@stylistic/eslint-plugin": "^5.
|
|
105
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
106
|
-
"@typescript-eslint/parser": "^8.
|
|
107
|
-
"@vitest/eslint-plugin": "^1.3.
|
|
104
|
+
"@stylistic/eslint-plugin": "^5.4.0",
|
|
105
|
+
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
106
|
+
"@typescript-eslint/parser": "^8.44.0",
|
|
107
|
+
"@vitest/eslint-plugin": "^1.3.12",
|
|
108
108
|
"ansis": "^4.1.0",
|
|
109
109
|
"cac": "^6.7.14",
|
|
110
110
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
@@ -113,20 +113,20 @@
|
|
|
113
113
|
"eslint-plugin-antfu": "^3.1.1",
|
|
114
114
|
"eslint-plugin-command": "^3.3.1",
|
|
115
115
|
"eslint-plugin-import-lite": "^0.3.0",
|
|
116
|
-
"eslint-plugin-jsdoc": "^
|
|
116
|
+
"eslint-plugin-jsdoc": "^59.0.2",
|
|
117
117
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
118
|
-
"eslint-plugin-n": "^17.
|
|
118
|
+
"eslint-plugin-n": "^17.23.1",
|
|
119
119
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
120
120
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
121
121
|
"eslint-plugin-pnpm": "^1.1.1",
|
|
122
122
|
"eslint-plugin-regexp": "^2.10.0",
|
|
123
123
|
"eslint-plugin-toml": "^0.12.0",
|
|
124
|
-
"eslint-plugin-unicorn": "^
|
|
124
|
+
"eslint-plugin-unicorn": "^61.0.2",
|
|
125
125
|
"eslint-plugin-unused-imports": "^4.2.0",
|
|
126
126
|
"eslint-plugin-vue": "^10.4.0",
|
|
127
127
|
"eslint-plugin-yml": "^1.18.0",
|
|
128
128
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
129
|
-
"globals": "^16.
|
|
129
|
+
"globals": "^16.4.0",
|
|
130
130
|
"jsonc-eslint-parser": "^2.4.0",
|
|
131
131
|
"local-pkg": "^1.1.2",
|
|
132
132
|
"parse-gitignore": "^2.0.0",
|
|
@@ -135,24 +135,24 @@
|
|
|
135
135
|
"yaml-eslint-parser": "^1.3.0"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
|
-
"@antfu/ni": "^
|
|
139
|
-
"@eslint-react/eslint-plugin": "^1.53.
|
|
140
|
-
"@eslint/config-inspector": "^1.
|
|
141
|
-
"@next/eslint-plugin-next": "^15.5.
|
|
138
|
+
"@antfu/ni": "^26.0.1",
|
|
139
|
+
"@eslint-react/eslint-plugin": "^1.53.1",
|
|
140
|
+
"@eslint/config-inspector": "^1.3.0",
|
|
141
|
+
"@next/eslint-plugin-next": "^15.5.3",
|
|
142
142
|
"@prettier/plugin-xml": "^3.4.2",
|
|
143
143
|
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
|
|
144
|
-
"@types/node": "^24.
|
|
145
|
-
"@unocss/eslint-plugin": "^66.5.
|
|
144
|
+
"@types/node": "^24.5.2",
|
|
145
|
+
"@unocss/eslint-plugin": "^66.5.1",
|
|
146
146
|
"astro-eslint-parser": "^1.2.2",
|
|
147
147
|
"bumpp": "^10.2.3",
|
|
148
|
-
"eslint": "^9.
|
|
148
|
+
"eslint": "^9.36.0",
|
|
149
149
|
"eslint-plugin-astro": "^1.3.1",
|
|
150
150
|
"eslint-plugin-format": "^1.0.1",
|
|
151
151
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
152
152
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
153
153
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
154
154
|
"eslint-plugin-solid": "^0.14.5",
|
|
155
|
-
"eslint-plugin-svelte": "^3.12.
|
|
155
|
+
"eslint-plugin-svelte": "^3.12.3",
|
|
156
156
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
157
157
|
"eslint-typegen": "^2.3.0",
|
|
158
158
|
"execa": "^9.6.0",
|
|
@@ -162,15 +162,15 @@
|
|
|
162
162
|
"prettier-plugin-astro": "^0.14.1",
|
|
163
163
|
"prettier-plugin-slidev": "^1.0.5",
|
|
164
164
|
"simple-git-hooks": "^2.13.1",
|
|
165
|
-
"svelte": "^5.
|
|
166
|
-
"svelte-eslint-parser": "^1.3.
|
|
167
|
-
"tinyglobby": "^0.2.
|
|
165
|
+
"svelte": "^5.39.2",
|
|
166
|
+
"svelte-eslint-parser": "^1.3.2",
|
|
167
|
+
"tinyglobby": "^0.2.15",
|
|
168
168
|
"tsdown": "^0.14.2",
|
|
169
169
|
"tsx": "^4.20.5",
|
|
170
170
|
"typescript": "^5.9.2",
|
|
171
171
|
"vitest": "^3.2.4",
|
|
172
172
|
"vue": "^3.5.21",
|
|
173
|
-
"@antfu/eslint-config": "5.
|
|
173
|
+
"@antfu/eslint-config": "5.4.0"
|
|
174
174
|
},
|
|
175
175
|
"resolutions": {
|
|
176
176
|
"eslint": "catalog:peer"
|