@antfu/eslint-config 2.8.2 → 2.8.3
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 +8 -10
- package/dist/cli.cjs +445 -151
- package/dist/cli.js +445 -151
- package/dist/index.cjs +4 -8
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +4 -8
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -512,14 +512,10 @@ async function ensurePackages(packages) {
|
|
|
512
512
|
const nonExistingPackages = packages.filter((i) => i && !(0, import_local_pkg.isPackageExists)(i));
|
|
513
513
|
if (nonExistingPackages.length === 0)
|
|
514
514
|
return;
|
|
515
|
-
const
|
|
516
|
-
const
|
|
517
|
-
{
|
|
518
|
-
|
|
519
|
-
name: "result",
|
|
520
|
-
type: "confirm"
|
|
521
|
-
}
|
|
522
|
-
]);
|
|
515
|
+
const p = await import("@clack/prompts");
|
|
516
|
+
const result = await p.confirm({
|
|
517
|
+
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
|
|
518
|
+
});
|
|
523
519
|
if (result)
|
|
524
520
|
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
525
521
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -320,7 +320,13 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
320
320
|
/**
|
|
321
321
|
* Enable ASTRO support.
|
|
322
322
|
*
|
|
323
|
-
*
|
|
323
|
+
* Requires installing:
|
|
324
|
+
* - `eslint-plugin-astro`
|
|
325
|
+
*
|
|
326
|
+
* Requires installing for formatting .astro:
|
|
327
|
+
* - `prettier-plugin-astro`
|
|
328
|
+
*
|
|
329
|
+
* @default false
|
|
324
330
|
*/
|
|
325
331
|
astro?: boolean | OptionsOverrides;
|
|
326
332
|
/**
|
|
@@ -404,6 +410,13 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
404
410
|
|
|
405
411
|
/**
|
|
406
412
|
* Construct an array of ESLint flat config items.
|
|
413
|
+
*
|
|
414
|
+
* @param {OptionsConfig & FlatConfigItem} options
|
|
415
|
+
* The options for generating the ESLint configurations.
|
|
416
|
+
* @param {Awaitable<UserConfigItem | UserConfigItem[]>[]} userConfigs
|
|
417
|
+
* The user configurations to be merged with the generated configurations.
|
|
418
|
+
* @returns {Promise<UserConfigItem[]>}
|
|
419
|
+
* The merged ESLint configurations.
|
|
407
420
|
*/
|
|
408
421
|
declare function antfu(options?: OptionsConfig & FlatConfigItem, ...userConfigs: Awaitable<UserConfigItem | UserConfigItem[]>[]): Promise<UserConfigItem[]>;
|
|
409
422
|
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
package/dist/index.d.ts
CHANGED
|
@@ -320,7 +320,13 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
320
320
|
/**
|
|
321
321
|
* Enable ASTRO support.
|
|
322
322
|
*
|
|
323
|
-
*
|
|
323
|
+
* Requires installing:
|
|
324
|
+
* - `eslint-plugin-astro`
|
|
325
|
+
*
|
|
326
|
+
* Requires installing for formatting .astro:
|
|
327
|
+
* - `prettier-plugin-astro`
|
|
328
|
+
*
|
|
329
|
+
* @default false
|
|
324
330
|
*/
|
|
325
331
|
astro?: boolean | OptionsOverrides;
|
|
326
332
|
/**
|
|
@@ -404,6 +410,13 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
404
410
|
|
|
405
411
|
/**
|
|
406
412
|
* Construct an array of ESLint flat config items.
|
|
413
|
+
*
|
|
414
|
+
* @param {OptionsConfig & FlatConfigItem} options
|
|
415
|
+
* The options for generating the ESLint configurations.
|
|
416
|
+
* @param {Awaitable<UserConfigItem | UserConfigItem[]>[]} userConfigs
|
|
417
|
+
* The user configurations to be merged with the generated configurations.
|
|
418
|
+
* @returns {Promise<UserConfigItem[]>}
|
|
419
|
+
* The merged ESLint configurations.
|
|
407
420
|
*/
|
|
408
421
|
declare function antfu(options?: OptionsConfig & FlatConfigItem, ...userConfigs: Awaitable<UserConfigItem | UserConfigItem[]>[]): Promise<UserConfigItem[]>;
|
|
409
422
|
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
package/dist/index.js
CHANGED
|
@@ -417,14 +417,10 @@ async function ensurePackages(packages) {
|
|
|
417
417
|
const nonExistingPackages = packages.filter((i) => i && !isPackageExists(i));
|
|
418
418
|
if (nonExistingPackages.length === 0)
|
|
419
419
|
return;
|
|
420
|
-
const
|
|
421
|
-
const
|
|
422
|
-
{
|
|
423
|
-
|
|
424
|
-
name: "result",
|
|
425
|
-
type: "confirm"
|
|
426
|
-
}
|
|
427
|
-
]);
|
|
420
|
+
const p = await import("@clack/prompts");
|
|
421
|
+
const result = await p.confirm({
|
|
422
|
+
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
|
|
423
|
+
});
|
|
428
424
|
if (result)
|
|
429
425
|
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
430
426
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antfu/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.8.
|
|
4
|
+
"version": "2.8.3",
|
|
5
5
|
"packageManager": "pnpm@8.15.4",
|
|
6
6
|
"description": "Anthony's ESLint config",
|
|
7
7
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@antfu/eslint-define-config": "^1.23.0-2",
|
|
78
78
|
"@antfu/install-pkg": "^0.3.1",
|
|
79
|
+
"@clack/prompts": "^0.7.0",
|
|
79
80
|
"@eslint-types/jsdoc": "46.8.2-1",
|
|
80
81
|
"@eslint-types/typescript-eslint": "^7.0.2",
|
|
81
82
|
"@eslint-types/unicorn": "^51.0.1",
|
|
@@ -105,7 +106,6 @@
|
|
|
105
106
|
"local-pkg": "^0.5.0",
|
|
106
107
|
"parse-gitignore": "^2.0.0",
|
|
107
108
|
"picocolors": "^1.0.0",
|
|
108
|
-
"prompts": "^2.4.2",
|
|
109
109
|
"toml-eslint-parser": "^0.9.3",
|
|
110
110
|
"vue-eslint-parser": "^9.4.2",
|
|
111
111
|
"yaml-eslint-parser": "^1.2.2",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"typescript": "^5.4.2",
|
|
148
148
|
"vitest": "^1.3.1",
|
|
149
149
|
"vue": "^3.4.21",
|
|
150
|
-
"@antfu/eslint-config": "2.8.
|
|
150
|
+
"@antfu/eslint-config": "2.8.3"
|
|
151
151
|
},
|
|
152
152
|
"simple-git-hooks": {
|
|
153
153
|
"pre-commit": "pnpm lint-staged"
|