@antfu/eslint-config 9.4.0 → 9.4.1
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.mjs +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.mjs +18 -5
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { cac } from "cac";
|
|
|
8
8
|
import parse from "parse-gitignore";
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "9.4.
|
|
11
|
+
var version = "9.4.1";
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/cli/constants.ts
|
|
14
14
|
const vscodeSettingsString = `
|
package/dist/index.d.mts
CHANGED
|
@@ -3718,6 +3718,11 @@ interface RuleOptions {
|
|
|
3718
3718
|
* @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm/src/rules/json/json-valid-catalog.test.ts
|
|
3719
3719
|
*/
|
|
3720
3720
|
'pnpm/json-valid-catalog'?: Linter.RuleEntry<PnpmJsonValidCatalog>;
|
|
3721
|
+
/**
|
|
3722
|
+
* Require blank lines around multi-line entries in `pnpm-workspace.yaml`, and disallow them between single-line entries
|
|
3723
|
+
* @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm/src/rules/yaml/yaml-blank-lines.test.ts
|
|
3724
|
+
*/
|
|
3725
|
+
'pnpm/yaml-blank-lines'?: Linter.RuleEntry<[]>;
|
|
3721
3726
|
/**
|
|
3722
3727
|
* Enforce settings in `pnpm-workspace.yaml`
|
|
3723
3728
|
* @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm/src/rules/yaml/yaml-enforce-settings.test.ts
|
|
@@ -21817,7 +21822,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
21817
21822
|
onlyEquality?: boolean;
|
|
21818
21823
|
}];
|
|
21819
21824
|
// Names of all the configs
|
|
21820
|
-
type ConfigNames = 'antfu/gitignore' | 'antfu/ignores' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/eslint-comments/rules' | 'antfu/command/rules' | 'antfu/perfectionist/setup' | 'antfu/node/setup' | 'antfu/node/rules' | 'antfu/jsdoc/setup' | 'antfu/jsdoc/rules' | 'antfu/imports/rules' | 'antfu/e18e/rules' | 'antfu/unicorn/setup' | 'antfu/unicorn/rules' | 'antfu/jsx/setup' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/type-aware-parser' | 'antfu/typescript/rules' | 'antfu/typescript/rules-type-aware' | 'antfu/typescript/erasable-syntax-only' | 'antfu/stylistic/rules' | 'antfu/regexp/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/react/typescript' | 'antfu/react/type-aware-rules' | 'antfu/nextjs/setup' | 'antfu/nextjs/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/unocss' | 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/angular/setup' | 'antfu/angular/rules/ts' | 'antfu/angular/rules/template' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/sort/package-json' | 'antfu/sort/tsconfig-json' | 'antfu/pnpm/package-json' | 'antfu/pnpm/pnpm-workspace-yaml' | 'antfu/pnpm/pnpm-workspace-yaml-sort' | 'antfu/yaml/setup' | 'antfu/yaml/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/rules' | 'antfu/markdown/disables/code' | 'antfu/formatter/setup' | 'antfu/formatter/css' | 'antfu/formatter/scss' | 'antfu/formatter/less' | 'antfu/formatter/html' | 'antfu/formatter/xml' | 'antfu/formatter/svg' | 'antfu/formatter/markdown' | 'antfu/formatter/astro' | 'antfu/formatter/astro/disables' | 'antfu/formatter/graphql' | 'antfu/disables/scripts' | 'antfu/disables/cli' | 'antfu/disables/bin' | 'antfu/disables/dts' | 'antfu/disables/cjs' | 'antfu/disables/config-files';
|
|
21825
|
+
type ConfigNames = 'antfu/gitignore' | 'antfu/ignores' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/eslint-comments/rules' | 'antfu/command/rules' | 'antfu/perfectionist/setup' | 'antfu/node/setup' | 'antfu/node/rules' | 'antfu/jsdoc/setup' | 'antfu/jsdoc/rules' | 'antfu/imports/rules' | 'antfu/e18e/rules' | 'antfu/unicorn/setup' | 'antfu/unicorn/rules' | 'antfu/jsx/setup' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/type-aware-parser' | 'antfu/typescript/rules' | 'antfu/typescript/rules-type-aware' | 'antfu/typescript/erasable-syntax-only' | 'antfu/stylistic/rules' | 'antfu/regexp/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/react/typescript' | 'antfu/react/type-aware-rules' | 'antfu/nextjs/setup' | 'antfu/nextjs/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/unocss' | 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/angular/setup' | 'antfu/angular/rules/ts' | 'antfu/angular/rules/template' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/sort/package-json' | 'antfu/sort/tsconfig-json' | 'antfu/pnpm/package-json' | 'antfu/pnpm/pnpm-workspace-yaml' | 'antfu/pnpm/pnpm-workspace-yaml-stylistic' | 'antfu/pnpm/pnpm-workspace-yaml-sort' | 'antfu/yaml/setup' | 'antfu/yaml/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/rules' | 'antfu/markdown/disables/code' | 'antfu/formatter/setup' | 'antfu/formatter/css' | 'antfu/formatter/scss' | 'antfu/formatter/less' | 'antfu/formatter/html' | 'antfu/formatter/xml' | 'antfu/formatter/svg' | 'antfu/formatter/markdown' | 'antfu/formatter/astro' | 'antfu/formatter/astro/disables' | 'antfu/formatter/graphql' | 'antfu/disables/scripts' | 'antfu/disables/cli' | 'antfu/disables/bin' | 'antfu/disables/dts' | 'antfu/disables/cjs' | 'antfu/disables/config-files';
|
|
21821
21826
|
//#endregion
|
|
21822
21827
|
//#region src/vender/prettier-types.d.ts
|
|
21823
21828
|
/**
|
|
@@ -22182,7 +22187,7 @@ interface OptionsRegExp {
|
|
|
22182
22187
|
interface OptionsIsInEditor {
|
|
22183
22188
|
isInEditor?: boolean;
|
|
22184
22189
|
}
|
|
22185
|
-
interface OptionsPnpm extends OptionsIsInEditor {
|
|
22190
|
+
interface OptionsPnpm extends OptionsIsInEditor, OptionsStylistic {
|
|
22186
22191
|
/**
|
|
22187
22192
|
* Requires catalogs usage
|
|
22188
22193
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -1228,7 +1228,7 @@ async function pnpm(options) {
|
|
|
1228
1228
|
interopDefault(import("eslint-plugin-yml")),
|
|
1229
1229
|
interopDefault(import("yaml-eslint-parser"))
|
|
1230
1230
|
]);
|
|
1231
|
-
const { catalogs = await detectCatalogUsage(), isInEditor = false, json = true, sort = true, yaml = true } = options;
|
|
1231
|
+
const { catalogs = await detectCatalogUsage(), isInEditor = false, json = true, sort = true, stylistic = true, yaml = true } = options;
|
|
1232
1232
|
const configs = [];
|
|
1233
1233
|
if (json) configs.push({
|
|
1234
1234
|
files: ["package.json", "**/package.json"],
|
|
@@ -1260,7 +1260,14 @@ async function pnpm(options) {
|
|
|
1260
1260
|
"pnpm/yaml-no-unused-catalog-item": "error"
|
|
1261
1261
|
}
|
|
1262
1262
|
});
|
|
1263
|
-
if (
|
|
1263
|
+
if (yaml && stylistic) configs.push({
|
|
1264
|
+
files: ["pnpm-workspace.yaml"],
|
|
1265
|
+
languageOptions: { parser: yamlParser },
|
|
1266
|
+
name: "antfu/pnpm/pnpm-workspace-yaml-stylistic",
|
|
1267
|
+
plugins: { pnpm: pluginPnpm },
|
|
1268
|
+
rules: { "pnpm/yaml-blank-lines": "error" }
|
|
1269
|
+
});
|
|
1270
|
+
if (yaml && sort) configs.push({
|
|
1264
1271
|
files: ["pnpm-workspace.yaml"],
|
|
1265
1272
|
languageOptions: { parser: yamlParser },
|
|
1266
1273
|
name: "antfu/pnpm/pnpm-workspace-yaml-sort",
|
|
@@ -1294,17 +1301,17 @@ async function pnpm(options) {
|
|
|
1294
1301
|
"blockExoticSubdeps",
|
|
1295
1302
|
"ignoredOptionalDependencies",
|
|
1296
1303
|
"minimumReleaseAge",
|
|
1297
|
-
"minimumReleaseAgeExclude",
|
|
1298
|
-
"minimumReleaseAgeExcludePrune",
|
|
1299
1304
|
"minimumReleaseAgeIgnoreMissingTime",
|
|
1300
1305
|
"minimumReleaseAgeStrict",
|
|
1306
|
+
"minimumReleaseAgeExcludePrune",
|
|
1307
|
+
"minimumReleaseAgeExclude",
|
|
1301
1308
|
"registrySupportsTimeField",
|
|
1302
1309
|
"resolutionMode",
|
|
1303
1310
|
"supportedArchitectures",
|
|
1304
1311
|
"trustLockfile",
|
|
1305
1312
|
"trustPolicy",
|
|
1306
|
-
"trustPolicyExclude",
|
|
1307
1313
|
"trustPolicyIgnoreAfter",
|
|
1314
|
+
"trustPolicyExclude",
|
|
1308
1315
|
"update"
|
|
1309
1316
|
],
|
|
1310
1317
|
...[
|
|
@@ -2423,6 +2430,11 @@ async function yaml(options = {}) {
|
|
|
2423
2430
|
"yaml/flow-sequence-bracket-spacing": "error",
|
|
2424
2431
|
"yaml/indent": ["error", typeof indent === "number" ? indent : 2],
|
|
2425
2432
|
"yaml/key-spacing": "error",
|
|
2433
|
+
"yaml/no-multiple-empty-lines": ["error", {
|
|
2434
|
+
max: 1,
|
|
2435
|
+
maxBOF: 0,
|
|
2436
|
+
maxEOF: 0
|
|
2437
|
+
}],
|
|
2426
2438
|
"yaml/no-tab-indent": "error",
|
|
2427
2439
|
"yaml/quotes": ["error", {
|
|
2428
2440
|
avoidEscape: true,
|
|
@@ -2589,6 +2601,7 @@ function antfu(options = {}, ...userConfigs) {
|
|
|
2589
2601
|
configs.push(pnpm({
|
|
2590
2602
|
isInEditor,
|
|
2591
2603
|
json: options.jsonc !== false,
|
|
2604
|
+
stylistic: stylisticOptions,
|
|
2592
2605
|
yaml: options.yaml !== false,
|
|
2593
2606
|
...optionsPnpm
|
|
2594
2607
|
}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antfu/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "9.4.
|
|
4
|
+
"version": "9.4.1",
|
|
5
5
|
"description": "Anthony's ESLint config",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"eslint-plugin-n": "^18.3.0",
|
|
132
132
|
"eslint-plugin-no-only-tests": "^3.4.0",
|
|
133
133
|
"eslint-plugin-perfectionist": "^5.10.1",
|
|
134
|
-
"eslint-plugin-pnpm": "^1.
|
|
134
|
+
"eslint-plugin-pnpm": "^1.9.1",
|
|
135
135
|
"eslint-plugin-regexp": "^3.2.0",
|
|
136
136
|
"eslint-plugin-toml": "^1.5.0",
|
|
137
137
|
"eslint-plugin-unicorn": "^74.0.0",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"@angular-eslint/eslint-plugin-template": "^22.2.0",
|
|
152
152
|
"@angular-eslint/template-parser": "^22.2.0",
|
|
153
153
|
"@angular/core": "^22.1.4",
|
|
154
|
-
"@antfu/eslint-config": "9.4.
|
|
154
|
+
"@antfu/eslint-config": "9.4.1",
|
|
155
155
|
"@antfu/ni": "^30.5.0",
|
|
156
156
|
"@eslint-react/eslint-plugin": "^5.18.6",
|
|
157
157
|
"@eslint/config-inspector": "^3.3.0",
|