@antfu/eslint-config 6.0.0 → 6.2.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/README.md +18 -12
- package/dist/cli.js +11 -11
- package/dist/index.d.ts +580 -161
- package/dist/index.js +14 -6
- package/dist/{lib-Cm-GRsZW.js → lib-BXP8gjK-.js} +609 -435
- package/package.json +29 -29
package/README.md
CHANGED
|
@@ -129,7 +129,7 @@ Add the following settings to your `.vscode/settings.json`:
|
|
|
129
129
|
"source.organizeImports": "never"
|
|
130
130
|
},
|
|
131
131
|
|
|
132
|
-
// Silent the stylistic rules in
|
|
132
|
+
// Silent the stylistic rules in your IDE, but still auto fix them
|
|
133
133
|
"eslint.rules.customizations": [
|
|
134
134
|
{ "rule": "style/*", "severity": "off", "fixable": true },
|
|
135
135
|
{ "rule": "format/*", "severity": "off", "fixable": true },
|
|
@@ -223,7 +223,7 @@ lspconfig.eslint.setup(
|
|
|
223
223
|
"postcss"
|
|
224
224
|
},
|
|
225
225
|
settings = {
|
|
226
|
-
-- Silent the stylistic rules in
|
|
226
|
+
-- Silent the stylistic rules in your IDE, but still auto fix them
|
|
227
227
|
rulesCustomizations = customizations,
|
|
228
228
|
},
|
|
229
229
|
}
|
|
@@ -274,11 +274,23 @@ And that's it! Or you can configure each integration individually, for example:
|
|
|
274
274
|
import antfu from '@antfu/eslint-config'
|
|
275
275
|
|
|
276
276
|
export default antfu({
|
|
277
|
-
// Type of the project. 'lib' for libraries, the default is 'app'
|
|
277
|
+
// Type of the project. 'lib' for libraries, the default is 'app'
|
|
278
278
|
type: 'lib',
|
|
279
279
|
|
|
280
|
+
// `.eslintignore` is no longer supported in Flat config, use `ignores` instead
|
|
281
|
+
// The `ignores` option in the option (first argument) is specifically treated to always be global ignores
|
|
282
|
+
// And will **extend** the config's default ignores, not override them
|
|
283
|
+
// You can also pass a function to modify the default ignores
|
|
284
|
+
ignores: [
|
|
285
|
+
'**/fixtures',
|
|
286
|
+
// ...globs
|
|
287
|
+
],
|
|
288
|
+
|
|
289
|
+
// Parse the `.gitignore` file to get the ignores, on by default
|
|
290
|
+
gitignore: true,
|
|
291
|
+
|
|
280
292
|
// Enable stylistic formatting rules
|
|
281
|
-
|
|
293
|
+
stylistic: true,
|
|
282
294
|
|
|
283
295
|
// Or customize the stylistic rules
|
|
284
296
|
stylistic: {
|
|
@@ -293,12 +305,6 @@ export default antfu({
|
|
|
293
305
|
// Disable jsonc and yaml support
|
|
294
306
|
jsonc: false,
|
|
295
307
|
yaml: false,
|
|
296
|
-
|
|
297
|
-
// `.eslintignore` is no longer supported in Flat config, use `ignores` instead
|
|
298
|
-
ignores: [
|
|
299
|
-
'**/fixtures',
|
|
300
|
-
// ...globs
|
|
301
|
-
]
|
|
302
308
|
})
|
|
303
309
|
```
|
|
304
310
|
|
|
@@ -402,11 +408,11 @@ type foo = { bar: 2 }
|
|
|
402
408
|
```
|
|
403
409
|
|
|
404
410
|
> [!NOTE]
|
|
405
|
-
> About plugin renaming - it is actually rather a
|
|
411
|
+
> About plugin renaming - it is actually rather a dangerous move that might lead to potential naming collisions, pointed out [here](https://github.com/eslint/eslint/discussions/17766) and [here](https://github.com/prettier/eslint-config-prettier#eslintconfigjs-flat-config-plugin-caveat). As this config also very **personal** and **opinionated**, I ambitiously position this config as the only **"top-level"** config per project, that might pivots the taste of how rules are named.
|
|
406
412
|
>
|
|
407
413
|
> This config cares more about the user-facings DX, and try to ease out the implementation details. For example, users could keep using the semantic `import/order` without ever knowing the underlying plugin has migrated twice to `eslint-plugin-i` and then to `eslint-plugin-import-x`. User are also not forced to migrate to the implicit `i/order` halfway only because we swapped the implementation to a fork.
|
|
408
414
|
>
|
|
409
|
-
> That said, it's probably still not a good idea. You might not want to
|
|
415
|
+
> That said, it's probably still not a good idea. You might not want to do this if you are maintaining your own eslint config.
|
|
410
416
|
>
|
|
411
417
|
> Feel free to open issues if you want to combine this config with some other config presets but faced naming collisions. I am happy to figure out a way to make them work. But at this moment I have no plan to revert the renaming.
|
|
412
418
|
|
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ import parse from "parse-gitignore";
|
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "6.
|
|
12
|
+
var version = "6.2.0";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/cli/constants.ts
|
|
@@ -24,7 +24,7 @@ const vscodeSettingsString = `
|
|
|
24
24
|
"source.organizeImports": "never"
|
|
25
25
|
},
|
|
26
26
|
|
|
27
|
-
// Silent the stylistic rules in
|
|
27
|
+
// Silent the stylistic rules in your IDE, but still auto fix them
|
|
28
28
|
"eslint.rules.customizations": [
|
|
29
29
|
{ "rule": "style/*", "severity": "off", "fixable": true },
|
|
30
30
|
{ "rule": "format/*", "severity": "off", "fixable": true },
|
|
@@ -172,20 +172,20 @@ async function updateEslintFiles(result) {
|
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/cli/constants-generated.ts
|
|
174
174
|
const versionsMap = {
|
|
175
|
-
"@eslint-react/eslint-plugin": "^2.2.
|
|
176
|
-
"@next/eslint-plugin-next": "^
|
|
177
|
-
"@unocss/eslint-plugin": "^66.5.
|
|
175
|
+
"@eslint-react/eslint-plugin": "^2.2.4",
|
|
176
|
+
"@next/eslint-plugin-next": "^16.0.1",
|
|
177
|
+
"@unocss/eslint-plugin": "^66.5.4",
|
|
178
178
|
"astro-eslint-parser": "^1.2.2",
|
|
179
|
-
"eslint": "^9.
|
|
180
|
-
"eslint-plugin-astro": "^1.
|
|
179
|
+
"eslint": "^9.38.0",
|
|
180
|
+
"eslint-plugin-astro": "^1.4.0",
|
|
181
181
|
"eslint-plugin-format": "^1.0.2",
|
|
182
|
-
"eslint-plugin-react-hooks": "^7.0.
|
|
183
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
182
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
183
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
184
184
|
"eslint-plugin-solid": "^0.14.5",
|
|
185
|
-
"eslint-plugin-svelte": "^3.
|
|
185
|
+
"eslint-plugin-svelte": "^3.13.0",
|
|
186
186
|
"prettier-plugin-astro": "^0.14.1",
|
|
187
187
|
"prettier-plugin-slidev": "^1.0.5",
|
|
188
|
-
"svelte-eslint-parser": "^1.
|
|
188
|
+
"svelte-eslint-parser": "^1.4.0"
|
|
189
189
|
};
|
|
190
190
|
|
|
191
191
|
//#endregion
|