@antfu/eslint-config 9.3.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/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"],
@@ -1252,6 +1252,7 @@ async function pnpm(options) {
1252
1252
  plugins: { pnpm: pluginPnpm },
1253
1253
  rules: {
1254
1254
  "pnpm/yaml-enforce-settings": ["error", { settings: {
1255
+ minimumReleaseAgeExcludePrune: true,
1255
1256
  shellEmulator: true,
1256
1257
  trustPolicy: "no-downgrade"
1257
1258
  } }],
@@ -1259,7 +1260,14 @@ async function pnpm(options) {
1259
1260
  "pnpm/yaml-no-unused-catalog-item": "error"
1260
1261
  }
1261
1262
  });
1262
- if (sort) configs.push({
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({
1263
1271
  files: ["pnpm-workspace.yaml"],
1264
1272
  languageOptions: { parser: yamlParser },
1265
1273
  name: "antfu/pnpm/pnpm-workspace-yaml-sort",
@@ -1269,65 +1277,190 @@ async function pnpm(options) {
1269
1277
  {
1270
1278
  order: [
1271
1279
  ...[
1272
- "cacheDir",
1280
+ "dedupeInjectedDeps",
1281
+ "disallowWorkspaceCycles",
1282
+ "failIfNoMatch",
1283
+ "ignoreWorkspaceCycles",
1284
+ "ignoreWorkspaceRootCheck",
1285
+ "includeWorkspaceRoot",
1286
+ "injectWorkspacePackages",
1287
+ "legacyDirFiltering",
1288
+ "linkWorkspacePackages",
1289
+ "preferWorkspacePackages",
1290
+ "saveWorkspaceProtocol",
1291
+ "sharedWorkspaceLockfile",
1292
+ "syncInjectedDepsAfterScripts"
1293
+ ],
1294
+ ...[
1273
1295
  "catalogMode",
1274
- "cleanupUnusedCatalogs",
1275
- "dedupeDirectDeps",
1276
- "deployAllFiles",
1277
- "enablePrePostScripts",
1278
- "engineStrict",
1296
+ "catalogPrune",
1297
+ "cleanupUnusedCatalogs"
1298
+ ],
1299
+ ...[
1300
+ "allowedDeprecatedVersions",
1301
+ "blockExoticSubdeps",
1302
+ "ignoredOptionalDependencies",
1303
+ "minimumReleaseAge",
1304
+ "minimumReleaseAgeIgnoreMissingTime",
1305
+ "minimumReleaseAgeStrict",
1306
+ "minimumReleaseAgeExcludePrune",
1307
+ "minimumReleaseAgeExclude",
1308
+ "registrySupportsTimeField",
1309
+ "resolutionMode",
1310
+ "supportedArchitectures",
1311
+ "trustLockfile",
1312
+ "trustPolicy",
1313
+ "trustPolicyIgnoreAfter",
1314
+ "trustPolicyExclude",
1315
+ "update"
1316
+ ],
1317
+ ...[
1318
+ "autoInstallPeers",
1319
+ "dedupePeerDependents",
1320
+ "dedupePeers",
1321
+ "peerDependencyRules",
1322
+ "resolvePeersFromWorkspaceRoot",
1323
+ "strictPeerDependencies"
1324
+ ],
1325
+ ...[
1326
+ "fetchMinSpeedKiBps",
1327
+ "fetchRetries",
1328
+ "fetchRetryFactor",
1329
+ "fetchRetryMaxtimeout",
1330
+ "fetchRetryMintimeout",
1331
+ "fetchTimeout",
1332
+ "fetchWarnTimeoutMs",
1333
+ "gitShallowHosts",
1334
+ "httpProxy",
1335
+ "httpsProxy",
1336
+ "localAddress",
1337
+ "maxsockets",
1338
+ "namedRegistries",
1339
+ "networkConcurrency",
1340
+ "noProxy",
1341
+ "registries",
1342
+ "registry",
1343
+ "strictSsl"
1344
+ ],
1345
+ ...[
1346
+ "dlxCacheMaxAge",
1347
+ "enableGlobalVirtualStore",
1348
+ "enableModulesDir",
1279
1349
  "extendNodePath",
1350
+ "modulesCacheMaxAge",
1351
+ "modulesDir",
1352
+ "nodeExperimentalPackageMap",
1353
+ "nodeLinker",
1354
+ "nodePackageMapType",
1355
+ "packageImportMethod",
1356
+ "preferSymlinkedExecutables",
1357
+ "symlink",
1358
+ "virtualStoreDir",
1359
+ "virtualStoreDirMaxLength",
1360
+ "virtualStoreOnly",
1361
+ "virtualStoreType"
1362
+ ],
1363
+ ...[
1280
1364
  "hoist",
1365
+ "hoistingLimits",
1281
1366
  "hoistPattern",
1282
1367
  "hoistWorkspacePackages",
1283
- "ignoreCompatibilityDb",
1368
+ "publicHoistPattern",
1369
+ "shamefullyHoist"
1370
+ ],
1371
+ ...[
1372
+ "frozenStore",
1373
+ "storeDir",
1374
+ "strictStorePkgContentCheck",
1375
+ "useRunningStoreServer",
1376
+ "verifyStoreIntegrity"
1377
+ ],
1378
+ ...[
1379
+ "gitBranchLockfile",
1380
+ "lockfile",
1381
+ "lockfileIncludeTarballUrl",
1382
+ "mergeGitBranchLockfilesBranchPattern",
1383
+ "peersSuffixMaxLength",
1384
+ "preferFrozenLockfile"
1385
+ ],
1386
+ ...[
1387
+ "childConcurrency",
1388
+ "dangerouslyAllowAllBuilds",
1389
+ "enablePrePostScripts",
1284
1390
  "ignoreDepScripts",
1285
1391
  "ignoreScripts",
1286
- "ignoreWorkspaceRootCheck",
1392
+ "nodeOptions",
1393
+ "requiredScripts",
1394
+ "scriptShell",
1395
+ "shellEmulator",
1396
+ "sideEffectsCache",
1397
+ "sideEffectsCacheReadonly",
1398
+ "strictDepBuilds",
1399
+ "unsafePerm",
1400
+ "verifyDepsBeforeRun"
1401
+ ],
1402
+ ...[
1287
1403
  "managePackageManagerVersions",
1288
- "minimumReleaseAge",
1289
- "minimumReleaseAgeExclude",
1290
- "modulesDir",
1291
- "nodeLinker",
1404
+ "nodeDownloadMirrors",
1292
1405
  "nodeVersion",
1293
- "optimisticRepeatInstall",
1294
1406
  "packageManagerStrict",
1295
1407
  "packageManagerStrictVersion",
1296
- "preferSymlinkedExecutables",
1297
- "preferWorkspacePackages",
1298
- "publicHoistPattern",
1299
- "registrySupportsTimeField",
1300
- "requiredScripts",
1301
- "resolutionMode",
1408
+ "pmOnFail",
1409
+ "runtimeOnFail"
1410
+ ],
1411
+ ...[
1412
+ "ci",
1413
+ "color",
1414
+ "engineStrict",
1415
+ "loglevel",
1416
+ "npmPath",
1417
+ "recursiveInstall",
1418
+ "updateNotifier",
1419
+ "useBetaCli",
1420
+ "useStderr"
1421
+ ],
1422
+ ...[
1423
+ "cacheDir",
1424
+ "globalBinDir",
1425
+ "globalDir",
1426
+ "globalPnpmfile",
1427
+ "globalShims",
1428
+ "ignorePnpmfile",
1429
+ "npmrcAuthFile",
1430
+ "pnpmfile",
1431
+ "stateDir"
1432
+ ],
1433
+ ...["audit", "versioning"],
1434
+ ...[
1435
+ "allowNonAppliedPatches",
1436
+ "dedupeDirectDeps",
1437
+ "deployAllFiles",
1438
+ "ignoreCompatibilityDb",
1439
+ "initAuthorEmail",
1440
+ "initAuthorName",
1441
+ "initAuthorUrl",
1442
+ "initLicense",
1443
+ "initVersion",
1444
+ "optimisticRepeatInstall",
1445
+ "saveExact",
1302
1446
  "savePrefix",
1303
- "scriptShell",
1304
- "shamefullyHoist",
1305
- "shellEmulator",
1306
- "stateDir",
1307
- "supportedArchitectures",
1308
- "symlink",
1309
- "tag",
1310
- "trustPolicy",
1311
- "trustPolicyExclude",
1312
- "updateNotifier"
1447
+ "tag"
1313
1448
  ],
1314
1449
  "packages",
1450
+ "packageConfigs",
1315
1451
  "overrides",
1452
+ "packageExtensions",
1316
1453
  "patchedDependencies",
1317
- "catalog",
1318
- "catalogs",
1454
+ "configDependencies",
1455
+ "allowBuilds",
1319
1456
  ...[
1320
- "allowedDeprecatedVersions",
1321
- "allowNonAppliedPatches",
1322
- "configDependencies",
1323
1457
  "ignoredBuiltDependencies",
1324
- "ignoredOptionalDependencies",
1325
1458
  "neverBuiltDependencies",
1326
1459
  "onlyBuiltDependencies",
1327
- "onlyBuiltDependenciesFile",
1328
- "packageExtensions",
1329
- "peerDependencyRules"
1330
- ]
1460
+ "onlyBuiltDependenciesFile"
1461
+ ],
1462
+ "catalog",
1463
+ "catalogs"
1331
1464
  ],
1332
1465
  pathPattern: "^$"
1333
1466
  },
@@ -2005,6 +2138,7 @@ async function typescript(options = {}) {
2005
2138
  plugins: { "erasable-syntax-only": await interopDefault(import("eslint-plugin-erasable-syntax-only")) },
2006
2139
  rules: {
2007
2140
  "erasable-syntax-only/enums": "error",
2141
+ "erasable-syntax-only/export-aliases": "error",
2008
2142
  "erasable-syntax-only/import-aliases": "error",
2009
2143
  "erasable-syntax-only/namespaces": "error",
2010
2144
  "erasable-syntax-only/parameter-properties": "error"
@@ -2296,6 +2430,11 @@ async function yaml(options = {}) {
2296
2430
  "yaml/flow-sequence-bracket-spacing": "error",
2297
2431
  "yaml/indent": ["error", typeof indent === "number" ? indent : 2],
2298
2432
  "yaml/key-spacing": "error",
2433
+ "yaml/no-multiple-empty-lines": ["error", {
2434
+ max: 1,
2435
+ maxBOF: 0,
2436
+ maxEOF: 0
2437
+ }],
2299
2438
  "yaml/no-tab-indent": "error",
2300
2439
  "yaml/quotes": ["error", {
2301
2440
  avoidEscape: true,
@@ -2462,6 +2601,7 @@ function antfu(options = {}, ...userConfigs) {
2462
2601
  configs.push(pnpm({
2463
2602
  isInEditor,
2464
2603
  json: options.jsonc !== false,
2604
+ stylistic: stylisticOptions,
2465
2605
  yaml: options.yaml !== false,
2466
2606
  ...optionsPnpm
2467
2607
  }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antfu/eslint-config",
3
3
  "type": "module",
4
- "version": "9.3.0",
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",
@@ -38,11 +38,11 @@
38
38
  "astro-eslint-parser": ">=1.0.2",
39
39
  "eslint": "^9.10.0 || ^10.0.0",
40
40
  "eslint-plugin-astro": ">=1.2.0",
41
- "eslint-plugin-erasable-syntax-only": "^0.4.2",
41
+ "eslint-plugin-erasable-syntax-only": "^0.7.1",
42
42
  "eslint-plugin-format": ">=0.1.0",
43
43
  "eslint-plugin-jsx-a11y": ">=6.10.2",
44
44
  "eslint-plugin-react-refresh": "^0.5.0",
45
- "eslint-plugin-solid": "^0.14.3",
45
+ "eslint-plugin-solid": "^0.17.0",
46
46
  "eslint-plugin-svelte": ">=2.35.1",
47
47
  "eslint-plugin-vuejs-accessibility": "^2.4.1",
48
48
  "prettier-plugin-astro": "^0.14.0",
@@ -111,35 +111,35 @@
111
111
  "dependencies": {
112
112
  "@antfu/install-pkg": "^2.0.1",
113
113
  "@clack/prompts": "^1.7.0",
114
- "@e18e/eslint-plugin": "^0.6.0",
114
+ "@e18e/eslint-plugin": "^0.8.0",
115
115
  "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
116
116
  "@eslint/markdown": "^8.0.3",
117
117
  "@stylistic/eslint-plugin": "^5.10.0",
118
- "@typescript-eslint/eslint-plugin": "^8.66.0",
119
- "@typescript-eslint/parser": "^8.66.0",
120
- "@vitest/eslint-plugin": "^1.6.26",
118
+ "@typescript-eslint/eslint-plugin": "^8.68.0",
119
+ "@typescript-eslint/parser": "^8.68.0",
120
+ "@vitest/eslint-plugin": "^1.6.27",
121
121
  "ansis": "^4.3.1",
122
122
  "cac": "^7.0.0",
123
- "eslint-config-flat-gitignore": "^2.3.0",
123
+ "eslint-config-flat-gitignore": "^2.4.0",
124
124
  "eslint-flat-config-utils": "^3.2.0",
125
125
  "eslint-merge-processors": "^2.0.0",
126
126
  "eslint-plugin-antfu": "^3.2.3",
127
127
  "eslint-plugin-command": "^4.0.0",
128
128
  "eslint-plugin-import-lite": "^0.6.0",
129
- "eslint-plugin-jsdoc": "^63.3.3",
130
- "eslint-plugin-jsonc": "^3.4.1",
131
- "eslint-plugin-n": "^18.2.2",
129
+ "eslint-plugin-jsdoc": "^64.3.2",
130
+ "eslint-plugin-jsonc": "^3.4.2",
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.7.0",
135
- "eslint-plugin-regexp": "^3.1.1",
134
+ "eslint-plugin-pnpm": "^1.9.1",
135
+ "eslint-plugin-regexp": "^3.2.0",
136
136
  "eslint-plugin-toml": "^1.5.0",
137
- "eslint-plugin-unicorn": "^73.0.0",
137
+ "eslint-plugin-unicorn": "^74.0.0",
138
138
  "eslint-plugin-unused-imports": "^4.4.1",
139
139
  "eslint-plugin-vue": "^10.10.0",
140
140
  "eslint-plugin-yml": "^3.8.1",
141
141
  "eslint-processor-vue-blocks": "^2.0.0",
142
- "globals": "^17.9.0",
142
+ "globals": "^17.11.0",
143
143
  "local-pkg": "^1.2.1",
144
144
  "parse-gitignore": "^2.0.0",
145
145
  "toml-eslint-parser": "^1.0.3",
@@ -147,51 +147,51 @@
147
147
  "yaml-eslint-parser": "^2.1.0"
148
148
  },
149
149
  "devDependencies": {
150
- "@angular-eslint/eslint-plugin": "^22.1.0",
151
- "@angular-eslint/eslint-plugin-template": "^22.1.0",
152
- "@angular-eslint/template-parser": "^22.1.0",
153
- "@angular/core": "^22.1.0",
154
- "@antfu/ni": "^30.3.0",
155
- "@eslint-react/eslint-plugin": "^5.18.2",
156
- "@eslint/config-inspector": "^3.2.0",
157
- "@next/eslint-plugin-next": "^16.3.0",
150
+ "@angular-eslint/eslint-plugin": "^22.2.0",
151
+ "@angular-eslint/eslint-plugin-template": "^22.2.0",
152
+ "@angular-eslint/template-parser": "^22.2.0",
153
+ "@angular/core": "^22.1.4",
154
+ "@antfu/eslint-config": "9.4.1",
155
+ "@antfu/ni": "^30.5.0",
156
+ "@eslint-react/eslint-plugin": "^5.18.6",
157
+ "@eslint/config-inspector": "^3.3.0",
158
+ "@next/eslint-plugin-next": "^16.3.3",
158
159
  "@prettier/plugin-xml": "^3.4.2",
159
160
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
160
- "@types/node": "^26.1.2",
161
- "@unocss/eslint-plugin": "^66.7.5",
162
- "astro-eslint-parser": "^3.0.0",
163
- "baseline-browser-mapping": "^2.11.12",
164
- "bumpp": "^12.1.1",
165
- "eslint": "^10.8.0",
161
+ "@types/node": "^26.4.0",
162
+ "@unocss/eslint-plugin": "^66.8.1",
163
+ "astro-eslint-parser": "^3.1.0",
164
+ "baseline-browser-mapping": "^2.11.20",
165
+ "bumpp": "^12.2.2",
166
+ "eslint": "^10.9.1",
166
167
  "eslint-plugin-astro": "^3.1.0",
167
- "eslint-plugin-erasable-syntax-only": "^0.4.2",
168
+ "eslint-plugin-erasable-syntax-only": "^0.7.1",
168
169
  "eslint-plugin-format": "^2.0.1",
169
170
  "eslint-plugin-jsx-a11y": "^6.10.2",
170
- "eslint-plugin-react-refresh": "^0.5.3",
171
- "eslint-plugin-solid": "^0.14.5",
172
- "eslint-plugin-svelte": "^3.22.0",
173
- "eslint-plugin-vuejs-accessibility": "^2.5.0",
171
+ "eslint-plugin-react-refresh": "^0.5.5",
172
+ "eslint-plugin-solid": "^0.17.0",
173
+ "eslint-plugin-svelte": "^3.23.0",
174
+ "eslint-plugin-vuejs-accessibility": "^2.6.0",
174
175
  "eslint-typegen": "^2.3.1",
175
176
  "find-up-simple": "^1.0.1",
176
177
  "jiti": "^2.7.0",
177
- "lint-staged": "^17.3.0",
178
- "pnpm-workspace-yaml": "^1.7.0",
178
+ "lint-staged": "^17.4.1",
179
+ "pnpm-workspace-yaml": "^1.8.0",
179
180
  "prettier-plugin-astro": "^0.14.1",
180
181
  "prettier-plugin-slidev": "^1.0.5",
181
- "simple-git-hooks": "^2.13.1",
182
+ "simple-git-hooks": "^2.14.0",
182
183
  "skills-npm": "^1.2.0",
183
- "svelte": "^5.56.8",
184
- "svelte-eslint-parser": "^1.8.0",
184
+ "svelte": "^5.57.0",
185
+ "svelte-eslint-parser": "^1.8.1",
185
186
  "tinyexec": "^1.3.0",
186
187
  "tinyglobby": "^0.2.17",
187
188
  "tsdown": "^0.22.14",
188
189
  "tsdown-stale-guard": "^0.1.3",
189
- "tsnapi": "^1.2.0",
190
- "tsx": "^4.23.6",
190
+ "tsnapi": "^1.4.0",
191
+ "tsx": "^4.23.13",
191
192
  "typescript": "^6.0.3",
192
- "vitest": "^4.1.10",
193
- "vue": "^3.5.40",
194
- "@antfu/eslint-config": "9.3.0"
193
+ "vitest": "^4.1.11",
194
+ "vue": "^3.5.42"
195
195
  },
196
196
  "resolutions": {
197
197
  "@eslint-community/eslint-utils": "catalog:peer",