@antfu/eslint-config 2.21.0 → 2.21.2
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 +0 -4
- package/dist/cli.cjs +34 -35
- package/dist/cli.js +34 -35
- package/dist/index.cjs +9 -7
- package/dist/index.d.cts +221 -186
- package/dist/index.d.ts +221 -186
- package/dist/index.js +9 -7
- package/package.json +34 -31
package/README.md
CHANGED
|
@@ -102,10 +102,6 @@ Add the following settings to your `.vscode/settings.json`:
|
|
|
102
102
|
|
|
103
103
|
```jsonc
|
|
104
104
|
{
|
|
105
|
-
// Enable the ESlint flat config support
|
|
106
|
-
// (remove this if your ESLint extension above v3.0.5)
|
|
107
|
-
"eslint.experimental.useFlatConfig": true,
|
|
108
|
-
|
|
109
105
|
// Disable the default formatter, use eslint instead
|
|
110
106
|
"prettier.enable": false,
|
|
111
107
|
"editor.formatOnSave": false,
|
package/dist/cli.cjs
CHANGED
|
@@ -48,8 +48,8 @@ var import_picocolors = __toESM(require("picocolors"), 1);
|
|
|
48
48
|
var package_default = {
|
|
49
49
|
name: "@antfu/eslint-config",
|
|
50
50
|
type: "module",
|
|
51
|
-
version: "2.21.
|
|
52
|
-
packageManager: "pnpm@9.
|
|
51
|
+
version: "2.21.2",
|
|
52
|
+
packageManager: "pnpm@9.4.0",
|
|
53
53
|
description: "Anthony's ESLint config",
|
|
54
54
|
author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
|
55
55
|
license: "MIT",
|
|
@@ -99,7 +99,7 @@ var package_default = {
|
|
|
99
99
|
"eslint-plugin-svelte": ">=2.35.1",
|
|
100
100
|
"prettier-plugin-astro": "^0.13.0",
|
|
101
101
|
"prettier-plugin-slidev": "^1.0.5",
|
|
102
|
-
"svelte-eslint-parser": "
|
|
102
|
+
"svelte-eslint-parser": ">=0.37.0"
|
|
103
103
|
},
|
|
104
104
|
peerDependenciesMeta: {
|
|
105
105
|
"@eslint-react/eslint-plugin": {
|
|
@@ -145,36 +145,36 @@ var package_default = {
|
|
|
145
145
|
dependencies: {
|
|
146
146
|
"@antfu/install-pkg": "^0.3.3",
|
|
147
147
|
"@clack/prompts": "^0.7.0",
|
|
148
|
-
"@stylistic/eslint-plugin": "^2.
|
|
149
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
150
|
-
"@typescript-eslint/parser": "^7.
|
|
148
|
+
"@stylistic/eslint-plugin": "^2.3.0",
|
|
149
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
150
|
+
"@typescript-eslint/parser": "^7.14.1",
|
|
151
151
|
"eslint-config-flat-gitignore": "^0.1.5",
|
|
152
152
|
"eslint-flat-config-utils": "^0.2.5",
|
|
153
153
|
"eslint-merge-processors": "^0.1.0",
|
|
154
154
|
"eslint-plugin-antfu": "^2.3.3",
|
|
155
155
|
"eslint-plugin-command": "^0.2.3",
|
|
156
156
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
157
|
-
"eslint-plugin-import-x": "^0.5.
|
|
158
|
-
"eslint-plugin-jsdoc": "^48.
|
|
157
|
+
"eslint-plugin-import-x": "^0.5.2",
|
|
158
|
+
"eslint-plugin-jsdoc": "^48.5.0",
|
|
159
159
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
160
160
|
"eslint-plugin-markdown": "^5.0.0",
|
|
161
|
-
"eslint-plugin-n": "^17.
|
|
161
|
+
"eslint-plugin-n": "^17.9.0",
|
|
162
162
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
163
|
-
"eslint-plugin-perfectionist": "^2.
|
|
163
|
+
"eslint-plugin-perfectionist": "^2.11.0",
|
|
164
164
|
"eslint-plugin-regexp": "^2.6.0",
|
|
165
|
-
"eslint-plugin-toml": "^0.11.
|
|
166
|
-
"eslint-plugin-unicorn": "^
|
|
165
|
+
"eslint-plugin-toml": "^0.11.1",
|
|
166
|
+
"eslint-plugin-unicorn": "^54.0.0",
|
|
167
167
|
"eslint-plugin-unused-imports": "^3.2.0",
|
|
168
168
|
"eslint-plugin-vitest": "^0.5.4",
|
|
169
169
|
"eslint-plugin-vue": "^9.26.0",
|
|
170
170
|
"eslint-plugin-yml": "^1.14.0",
|
|
171
171
|
"eslint-processor-vue-blocks": "^0.1.2",
|
|
172
|
-
globals: "^15.
|
|
172
|
+
globals: "^15.6.0",
|
|
173
173
|
"jsonc-eslint-parser": "^2.4.0",
|
|
174
174
|
"local-pkg": "^0.5.0",
|
|
175
175
|
"parse-gitignore": "^2.0.0",
|
|
176
176
|
picocolors: "^1.0.1",
|
|
177
|
-
"toml-eslint-parser": "^0.
|
|
177
|
+
"toml-eslint-parser": "^0.10.0",
|
|
178
178
|
"vue-eslint-parser": "^9.4.3",
|
|
179
179
|
"yaml-eslint-parser": "^1.2.3",
|
|
180
180
|
yargs: "^17.7.2"
|
|
@@ -182,43 +182,46 @@ var package_default = {
|
|
|
182
182
|
devDependencies: {
|
|
183
183
|
"@antfu/eslint-config": "workspace:*",
|
|
184
184
|
"@antfu/ni": "^0.21.12",
|
|
185
|
-
"@eslint-react/eslint-plugin": "^1.5.
|
|
186
|
-
"@eslint/config-inspector": "^0.
|
|
185
|
+
"@eslint-react/eslint-plugin": "^1.5.18",
|
|
186
|
+
"@eslint/config-inspector": "^0.5.1",
|
|
187
187
|
"@prettier/plugin-xml": "^3.4.1",
|
|
188
|
-
"@stylistic/eslint-plugin-migrate": "^2.
|
|
188
|
+
"@stylistic/eslint-plugin-migrate": "^2.3.0",
|
|
189
189
|
"@types/eslint": "^8.56.10",
|
|
190
190
|
"@types/fs-extra": "^11.0.4",
|
|
191
|
-
"@types/node": "^20.14.
|
|
191
|
+
"@types/node": "^20.14.9",
|
|
192
192
|
"@types/prompts": "^2.4.9",
|
|
193
193
|
"@types/yargs": "^17.0.32",
|
|
194
|
-
"@unocss/eslint-plugin": "^0.
|
|
194
|
+
"@unocss/eslint-plugin": "^0.61.0",
|
|
195
195
|
"astro-eslint-parser": "^1.0.2",
|
|
196
196
|
bumpp: "^9.4.1",
|
|
197
|
-
eslint: "npm:eslint-ts-patch@9.
|
|
198
|
-
"eslint-plugin-astro": "^1.2.
|
|
199
|
-
"eslint-plugin-format": "^0.1.
|
|
197
|
+
eslint: "npm:eslint-ts-patch@9.5.0-0",
|
|
198
|
+
"eslint-plugin-astro": "^1.2.2",
|
|
199
|
+
"eslint-plugin-format": "^0.1.2",
|
|
200
200
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
201
201
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
202
|
-
"eslint-plugin-solid": "^0.14.
|
|
203
|
-
"eslint-plugin-svelte": "^2.
|
|
204
|
-
"eslint-ts-patch": "9.
|
|
202
|
+
"eslint-plugin-solid": "^0.14.1",
|
|
203
|
+
"eslint-plugin-svelte": "^2.41.0",
|
|
204
|
+
"eslint-ts-patch": "9.5.0-0",
|
|
205
205
|
"eslint-typegen": "^0.2.4",
|
|
206
206
|
esno: "^4.7.0",
|
|
207
|
-
execa: "^9.
|
|
207
|
+
execa: "^9.3.0",
|
|
208
208
|
"fast-glob": "^3.3.2",
|
|
209
209
|
"fs-extra": "^11.2.0",
|
|
210
|
-
"lint-staged": "^15.2.
|
|
210
|
+
"lint-staged": "^15.2.7",
|
|
211
211
|
"prettier-plugin-astro": "^0.14.0",
|
|
212
212
|
"prettier-plugin-slidev": "^1.0.5",
|
|
213
213
|
rimraf: "^5.0.7",
|
|
214
214
|
"simple-git-hooks": "^2.11.1",
|
|
215
215
|
svelte: "^4.2.18",
|
|
216
|
-
"svelte-eslint-parser": "^0.
|
|
216
|
+
"svelte-eslint-parser": "^0.39.2",
|
|
217
217
|
tsup: "^8.1.0",
|
|
218
|
-
tsx: "^4.
|
|
219
|
-
typescript: "^5.
|
|
218
|
+
tsx: "^4.15.7",
|
|
219
|
+
typescript: "^5.5.2",
|
|
220
220
|
vitest: "^1.6.0",
|
|
221
|
-
vue: "^3.4.
|
|
221
|
+
vue: "^3.4.31"
|
|
222
|
+
},
|
|
223
|
+
resolutions: {
|
|
224
|
+
tsx: "~4.14"
|
|
222
225
|
},
|
|
223
226
|
"simple-git-hooks": {
|
|
224
227
|
"pre-commit": "npx lint-staged"
|
|
@@ -230,10 +233,6 @@ var package_default = {
|
|
|
230
233
|
|
|
231
234
|
// src/cli/constants.ts
|
|
232
235
|
var vscodeSettingsString = `
|
|
233
|
-
// Enable the ESlint flat config support
|
|
234
|
-
// (remove this if your ESLint extension above v3.0.5)
|
|
235
|
-
"eslint.experimental.useFlatConfig": true,
|
|
236
|
-
|
|
237
236
|
// Disable the default formatter, use eslint instead
|
|
238
237
|
"prettier.enable": false,
|
|
239
238
|
"editor.formatOnSave": false,
|
package/dist/cli.js
CHANGED
|
@@ -19,8 +19,8 @@ import c from "picocolors";
|
|
|
19
19
|
var package_default = {
|
|
20
20
|
name: "@antfu/eslint-config",
|
|
21
21
|
type: "module",
|
|
22
|
-
version: "2.21.
|
|
23
|
-
packageManager: "pnpm@9.
|
|
22
|
+
version: "2.21.2",
|
|
23
|
+
packageManager: "pnpm@9.4.0",
|
|
24
24
|
description: "Anthony's ESLint config",
|
|
25
25
|
author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
|
26
26
|
license: "MIT",
|
|
@@ -70,7 +70,7 @@ var package_default = {
|
|
|
70
70
|
"eslint-plugin-svelte": ">=2.35.1",
|
|
71
71
|
"prettier-plugin-astro": "^0.13.0",
|
|
72
72
|
"prettier-plugin-slidev": "^1.0.5",
|
|
73
|
-
"svelte-eslint-parser": "
|
|
73
|
+
"svelte-eslint-parser": ">=0.37.0"
|
|
74
74
|
},
|
|
75
75
|
peerDependenciesMeta: {
|
|
76
76
|
"@eslint-react/eslint-plugin": {
|
|
@@ -116,36 +116,36 @@ var package_default = {
|
|
|
116
116
|
dependencies: {
|
|
117
117
|
"@antfu/install-pkg": "^0.3.3",
|
|
118
118
|
"@clack/prompts": "^0.7.0",
|
|
119
|
-
"@stylistic/eslint-plugin": "^2.
|
|
120
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
121
|
-
"@typescript-eslint/parser": "^7.
|
|
119
|
+
"@stylistic/eslint-plugin": "^2.3.0",
|
|
120
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
121
|
+
"@typescript-eslint/parser": "^7.14.1",
|
|
122
122
|
"eslint-config-flat-gitignore": "^0.1.5",
|
|
123
123
|
"eslint-flat-config-utils": "^0.2.5",
|
|
124
124
|
"eslint-merge-processors": "^0.1.0",
|
|
125
125
|
"eslint-plugin-antfu": "^2.3.3",
|
|
126
126
|
"eslint-plugin-command": "^0.2.3",
|
|
127
127
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
128
|
-
"eslint-plugin-import-x": "^0.5.
|
|
129
|
-
"eslint-plugin-jsdoc": "^48.
|
|
128
|
+
"eslint-plugin-import-x": "^0.5.2",
|
|
129
|
+
"eslint-plugin-jsdoc": "^48.5.0",
|
|
130
130
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
131
131
|
"eslint-plugin-markdown": "^5.0.0",
|
|
132
|
-
"eslint-plugin-n": "^17.
|
|
132
|
+
"eslint-plugin-n": "^17.9.0",
|
|
133
133
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
134
|
-
"eslint-plugin-perfectionist": "^2.
|
|
134
|
+
"eslint-plugin-perfectionist": "^2.11.0",
|
|
135
135
|
"eslint-plugin-regexp": "^2.6.0",
|
|
136
|
-
"eslint-plugin-toml": "^0.11.
|
|
137
|
-
"eslint-plugin-unicorn": "^
|
|
136
|
+
"eslint-plugin-toml": "^0.11.1",
|
|
137
|
+
"eslint-plugin-unicorn": "^54.0.0",
|
|
138
138
|
"eslint-plugin-unused-imports": "^3.2.0",
|
|
139
139
|
"eslint-plugin-vitest": "^0.5.4",
|
|
140
140
|
"eslint-plugin-vue": "^9.26.0",
|
|
141
141
|
"eslint-plugin-yml": "^1.14.0",
|
|
142
142
|
"eslint-processor-vue-blocks": "^0.1.2",
|
|
143
|
-
globals: "^15.
|
|
143
|
+
globals: "^15.6.0",
|
|
144
144
|
"jsonc-eslint-parser": "^2.4.0",
|
|
145
145
|
"local-pkg": "^0.5.0",
|
|
146
146
|
"parse-gitignore": "^2.0.0",
|
|
147
147
|
picocolors: "^1.0.1",
|
|
148
|
-
"toml-eslint-parser": "^0.
|
|
148
|
+
"toml-eslint-parser": "^0.10.0",
|
|
149
149
|
"vue-eslint-parser": "^9.4.3",
|
|
150
150
|
"yaml-eslint-parser": "^1.2.3",
|
|
151
151
|
yargs: "^17.7.2"
|
|
@@ -153,43 +153,46 @@ var package_default = {
|
|
|
153
153
|
devDependencies: {
|
|
154
154
|
"@antfu/eslint-config": "workspace:*",
|
|
155
155
|
"@antfu/ni": "^0.21.12",
|
|
156
|
-
"@eslint-react/eslint-plugin": "^1.5.
|
|
157
|
-
"@eslint/config-inspector": "^0.
|
|
156
|
+
"@eslint-react/eslint-plugin": "^1.5.18",
|
|
157
|
+
"@eslint/config-inspector": "^0.5.1",
|
|
158
158
|
"@prettier/plugin-xml": "^3.4.1",
|
|
159
|
-
"@stylistic/eslint-plugin-migrate": "^2.
|
|
159
|
+
"@stylistic/eslint-plugin-migrate": "^2.3.0",
|
|
160
160
|
"@types/eslint": "^8.56.10",
|
|
161
161
|
"@types/fs-extra": "^11.0.4",
|
|
162
|
-
"@types/node": "^20.14.
|
|
162
|
+
"@types/node": "^20.14.9",
|
|
163
163
|
"@types/prompts": "^2.4.9",
|
|
164
164
|
"@types/yargs": "^17.0.32",
|
|
165
|
-
"@unocss/eslint-plugin": "^0.
|
|
165
|
+
"@unocss/eslint-plugin": "^0.61.0",
|
|
166
166
|
"astro-eslint-parser": "^1.0.2",
|
|
167
167
|
bumpp: "^9.4.1",
|
|
168
|
-
eslint: "npm:eslint-ts-patch@9.
|
|
169
|
-
"eslint-plugin-astro": "^1.2.
|
|
170
|
-
"eslint-plugin-format": "^0.1.
|
|
168
|
+
eslint: "npm:eslint-ts-patch@9.5.0-0",
|
|
169
|
+
"eslint-plugin-astro": "^1.2.2",
|
|
170
|
+
"eslint-plugin-format": "^0.1.2",
|
|
171
171
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
172
172
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
173
|
-
"eslint-plugin-solid": "^0.14.
|
|
174
|
-
"eslint-plugin-svelte": "^2.
|
|
175
|
-
"eslint-ts-patch": "9.
|
|
173
|
+
"eslint-plugin-solid": "^0.14.1",
|
|
174
|
+
"eslint-plugin-svelte": "^2.41.0",
|
|
175
|
+
"eslint-ts-patch": "9.5.0-0",
|
|
176
176
|
"eslint-typegen": "^0.2.4",
|
|
177
177
|
esno: "^4.7.0",
|
|
178
|
-
execa: "^9.
|
|
178
|
+
execa: "^9.3.0",
|
|
179
179
|
"fast-glob": "^3.3.2",
|
|
180
180
|
"fs-extra": "^11.2.0",
|
|
181
|
-
"lint-staged": "^15.2.
|
|
181
|
+
"lint-staged": "^15.2.7",
|
|
182
182
|
"prettier-plugin-astro": "^0.14.0",
|
|
183
183
|
"prettier-plugin-slidev": "^1.0.5",
|
|
184
184
|
rimraf: "^5.0.7",
|
|
185
185
|
"simple-git-hooks": "^2.11.1",
|
|
186
186
|
svelte: "^4.2.18",
|
|
187
|
-
"svelte-eslint-parser": "^0.
|
|
187
|
+
"svelte-eslint-parser": "^0.39.2",
|
|
188
188
|
tsup: "^8.1.0",
|
|
189
|
-
tsx: "^4.
|
|
190
|
-
typescript: "^5.
|
|
189
|
+
tsx: "^4.15.7",
|
|
190
|
+
typescript: "^5.5.2",
|
|
191
191
|
vitest: "^1.6.0",
|
|
192
|
-
vue: "^3.4.
|
|
192
|
+
vue: "^3.4.31"
|
|
193
|
+
},
|
|
194
|
+
resolutions: {
|
|
195
|
+
tsx: "~4.14"
|
|
193
196
|
},
|
|
194
197
|
"simple-git-hooks": {
|
|
195
198
|
"pre-commit": "npx lint-staged"
|
|
@@ -201,10 +204,6 @@ var package_default = {
|
|
|
201
204
|
|
|
202
205
|
// src/cli/constants.ts
|
|
203
206
|
var vscodeSettingsString = `
|
|
204
|
-
// Enable the ESlint flat config support
|
|
205
|
-
// (remove this if your ESLint extension above v3.0.5)
|
|
206
|
-
"eslint.experimental.useFlatConfig": true,
|
|
207
|
-
|
|
208
207
|
// Disable the default formatter, use eslint instead
|
|
209
208
|
"prettier.enable": false,
|
|
210
209
|
"editor.formatOnSave": false,
|
package/dist/index.cjs
CHANGED
|
@@ -178,6 +178,7 @@ var GLOB_EXCLUDE = [
|
|
|
178
178
|
"**/.output",
|
|
179
179
|
"**/.vite-inspect",
|
|
180
180
|
"**/.yarn",
|
|
181
|
+
"**/vite.config.*.timestamp-*",
|
|
181
182
|
"**/CHANGELOG*.md",
|
|
182
183
|
"**/*.min.*",
|
|
183
184
|
"**/LICENSE*",
|
|
@@ -1445,6 +1446,7 @@ async function sortPackageJson() {
|
|
|
1445
1446
|
"packageManager",
|
|
1446
1447
|
"description",
|
|
1447
1448
|
"author",
|
|
1449
|
+
"contributors",
|
|
1448
1450
|
"license",
|
|
1449
1451
|
"funding",
|
|
1450
1452
|
"homepage",
|
|
@@ -1885,9 +1887,12 @@ async function typescript(options = {}) {
|
|
|
1885
1887
|
"ts/no-unsafe-call": "error",
|
|
1886
1888
|
"ts/no-unsafe-member-access": "error",
|
|
1887
1889
|
"ts/no-unsafe-return": "error",
|
|
1890
|
+
"ts/promise-function-async": "error",
|
|
1888
1891
|
"ts/restrict-plus-operands": "error",
|
|
1889
1892
|
"ts/restrict-template-expressions": "error",
|
|
1890
|
-
"ts/
|
|
1893
|
+
"ts/return-await": ["error", "in-try-catch"],
|
|
1894
|
+
"ts/strict-boolean-expressions": ["error", { allowNullableBoolean: true, allowNullableObject: true }],
|
|
1895
|
+
"ts/switch-exhaustiveness-check": "error",
|
|
1891
1896
|
"ts/unbound-method": "error"
|
|
1892
1897
|
};
|
|
1893
1898
|
const [
|
|
@@ -1978,13 +1983,10 @@ async function typescript(options = {}) {
|
|
|
1978
1983
|
files: filesTypeAware,
|
|
1979
1984
|
ignores: ignoresTypeAware,
|
|
1980
1985
|
name: "antfu/typescript/rules-type-aware",
|
|
1981
|
-
rules:
|
|
1982
|
-
...tsconfigPath ? typeAwareRules : {},
|
|
1983
|
-
...overrides
|
|
1984
|
-
}
|
|
1986
|
+
rules: typeAwareRules
|
|
1985
1987
|
}] : [],
|
|
1986
1988
|
{
|
|
1987
|
-
files: ["**/*.d
|
|
1989
|
+
files: ["**/*.d.?([cm])ts"],
|
|
1988
1990
|
name: "antfu/typescript/disables/dts",
|
|
1989
1991
|
rules: {
|
|
1990
1992
|
"eslint-comments/no-unlimited-disable": "off",
|
|
@@ -2371,7 +2373,7 @@ function antfu(options = {}, ...userConfigs) {
|
|
|
2371
2373
|
autoRenamePlugins = true,
|
|
2372
2374
|
componentExts = [],
|
|
2373
2375
|
gitignore: enableGitignore = true,
|
|
2374
|
-
isInEditor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.VSCODE_CWD || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM) && !import_node_process3.default.env.CI),
|
|
2376
|
+
isInEditor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.VSCODE_CWD || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM || import_node_process3.default.env.NVIM) && !import_node_process3.default.env.CI),
|
|
2375
2377
|
jsx: enableJsx = true,
|
|
2376
2378
|
react: enableReact = false,
|
|
2377
2379
|
regexp: enableRegexp = true,
|