@lincy/eslint-config 5.8.0 → 5.9.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/dist/index.cjs +43 -24
- package/dist/index.d.cts +417 -191
- package/dist/index.d.ts +417 -191
- package/dist/index.js +13 -9
- package/package.json +37 -37
package/dist/index.js
CHANGED
|
@@ -187,8 +187,7 @@ const parserPlain = {
|
|
|
187
187
|
* Combine array and non-array configs into a single array.
|
|
188
188
|
*/
|
|
189
189
|
async function combine(...configs$1) {
|
|
190
|
-
|
|
191
|
-
return resolved.flat();
|
|
190
|
+
return (await Promise.all(configs$1)).flat();
|
|
192
191
|
}
|
|
193
192
|
function renameRules(rules, map) {
|
|
194
193
|
return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
|
|
@@ -221,9 +220,7 @@ async function ensurePackages(packages) {
|
|
|
221
220
|
if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false) return;
|
|
222
221
|
const nonExistingPackages = packages.filter((i) => i && !isPackageInScope(i));
|
|
223
222
|
if (nonExistingPackages.length === 0) return;
|
|
224
|
-
|
|
225
|
-
const result = await p.confirm({ message: `此配置需要软件包: ${nonExistingPackages.join(", ")}. 你想安装它们吗?` });
|
|
226
|
-
if (result) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
223
|
+
if (await (await import("@clack/prompts")).confirm({ message: `此配置需要软件包: ${nonExistingPackages.join(", ")}. 你想安装它们吗?` })) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
227
224
|
}
|
|
228
225
|
function isInEditorEnv() {
|
|
229
226
|
if (process.env.CI) return false;
|
|
@@ -342,10 +339,9 @@ async function formatters(options = {}, stylistic$1 = {}) {
|
|
|
342
339
|
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
343
340
|
useTabs: indent === "tab"
|
|
344
341
|
}, options.dprintOptions || {});
|
|
345
|
-
const pluginFormat = await interopDefault(import("eslint-plugin-format"));
|
|
346
342
|
const configs$1 = [{
|
|
347
343
|
name: "eslint/formatter/setup",
|
|
348
|
-
plugins: { format:
|
|
344
|
+
plugins: { format: await interopDefault(import("eslint-plugin-format")) }
|
|
349
345
|
}];
|
|
350
346
|
if (options.css) configs$1.push({
|
|
351
347
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
@@ -459,7 +455,7 @@ async function javascript(options = {}) {
|
|
|
459
455
|
const { isInEditor = false, overrides = {} } = options;
|
|
460
456
|
return [{
|
|
461
457
|
languageOptions: {
|
|
462
|
-
ecmaVersion:
|
|
458
|
+
ecmaVersion: "latest",
|
|
463
459
|
globals: {
|
|
464
460
|
...globals.browser,
|
|
465
461
|
...globals.es2021,
|
|
@@ -470,7 +466,7 @@ async function javascript(options = {}) {
|
|
|
470
466
|
},
|
|
471
467
|
parserOptions: {
|
|
472
468
|
ecmaFeatures: { jsx: true },
|
|
473
|
-
ecmaVersion:
|
|
469
|
+
ecmaVersion: "latest",
|
|
474
470
|
sourceType: "module"
|
|
475
471
|
},
|
|
476
472
|
sourceType: "module"
|
|
@@ -1248,6 +1244,14 @@ async function sortPackageJson() {
|
|
|
1248
1244
|
order: { type: "asc" },
|
|
1249
1245
|
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
1250
1246
|
},
|
|
1247
|
+
{
|
|
1248
|
+
order: { type: "asc" },
|
|
1249
|
+
pathPattern: "^workspaces\\.catalog$"
|
|
1250
|
+
},
|
|
1251
|
+
{
|
|
1252
|
+
order: { type: "asc" },
|
|
1253
|
+
pathPattern: "^workspaces\\.catalogs\\.[^.]+$"
|
|
1254
|
+
},
|
|
1251
1255
|
{
|
|
1252
1256
|
order: [
|
|
1253
1257
|
"types",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincy/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.9.0",
|
|
5
5
|
"description": "LinCenYing's ESLint config",
|
|
6
6
|
"author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -58,70 +58,70 @@
|
|
|
58
58
|
"@antfu/install-pkg": "^1.1.0",
|
|
59
59
|
"@clack/prompts": "^0.11.0",
|
|
60
60
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
61
|
-
"@eslint/markdown": "^7.
|
|
62
|
-
"@stylistic/eslint-plugin": "^5.
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
64
|
-
"@typescript-eslint/parser": "^8.
|
|
65
|
-
"@vitest/eslint-plugin": "^1.3.
|
|
61
|
+
"@eslint/markdown": "^7.3.0",
|
|
62
|
+
"@stylistic/eslint-plugin": "^5.4.0",
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
64
|
+
"@typescript-eslint/parser": "^8.44.1",
|
|
65
|
+
"@vitest/eslint-plugin": "^1.3.12",
|
|
66
66
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
67
|
-
"eslint-flat-config-utils": "^2.1.
|
|
67
|
+
"eslint-flat-config-utils": "^2.1.4",
|
|
68
68
|
"eslint-merge-processors": "^2.0.0",
|
|
69
69
|
"eslint-parser-plain": "^0.1.1",
|
|
70
70
|
"eslint-plugin-antfu": "^3.1.1",
|
|
71
71
|
"eslint-plugin-import-lite": "^0.3.0",
|
|
72
|
-
"eslint-plugin-jsdoc": "^
|
|
72
|
+
"eslint-plugin-jsdoc": "^60.3.0",
|
|
73
73
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
74
|
-
"eslint-plugin-n": "^17.
|
|
74
|
+
"eslint-plugin-n": "^17.23.1",
|
|
75
75
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
76
76
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
77
|
-
"eslint-plugin-pnpm": "^1.1.
|
|
78
|
-
"eslint-plugin-regexp": "^2.
|
|
77
|
+
"eslint-plugin-pnpm": "^1.1.2",
|
|
78
|
+
"eslint-plugin-regexp": "^2.10.0",
|
|
79
79
|
"eslint-plugin-toml": "^0.12.0",
|
|
80
|
-
"eslint-plugin-unicorn": "^
|
|
81
|
-
"eslint-plugin-unused-imports": "^4.
|
|
82
|
-
"eslint-plugin-vue": "^10.
|
|
80
|
+
"eslint-plugin-unicorn": "^61.0.2",
|
|
81
|
+
"eslint-plugin-unused-imports": "^4.2.0",
|
|
82
|
+
"eslint-plugin-vue": "^10.5.0",
|
|
83
83
|
"eslint-plugin-yml": "^1.18.0",
|
|
84
84
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
85
|
-
"globals": "^16.
|
|
86
|
-
"jsonc-eslint-parser": "^2.4.
|
|
87
|
-
"local-pkg": "^1.1.
|
|
85
|
+
"globals": "^16.4.0",
|
|
86
|
+
"jsonc-eslint-parser": "^2.4.1",
|
|
87
|
+
"local-pkg": "^1.1.2",
|
|
88
88
|
"prompts": "^2.4.2",
|
|
89
89
|
"toml-eslint-parser": "^0.10.0",
|
|
90
90
|
"vue-eslint-parser": "^10.2.0",
|
|
91
91
|
"yaml-eslint-parser": "^1.3.0"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@antfu/ni": "^
|
|
95
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
94
|
+
"@antfu/ni": "^26.0.1",
|
|
95
|
+
"@eslint-react/eslint-plugin": "^1.53.1",
|
|
96
96
|
"@eslint-types/typescript-eslint": "^7.5.0",
|
|
97
97
|
"@eslint-types/unicorn": "^52.0.0",
|
|
98
|
-
"@eslint/config-inspector": "^1.
|
|
99
|
-
"@next/eslint-plugin-next": "^15.4
|
|
98
|
+
"@eslint/config-inspector": "^1.3.0",
|
|
99
|
+
"@next/eslint-plugin-next": "^15.5.4",
|
|
100
100
|
"@prettier/plugin-xml": "^3.4.2",
|
|
101
101
|
"@stylistic/eslint-plugin-migrate": "^4.4.1",
|
|
102
|
-
"@types/node": "^24.
|
|
103
|
-
"@types/react": "^19.1.
|
|
104
|
-
"@unocss/eslint-plugin": "^66.
|
|
105
|
-
"bumpp": "^10.2.
|
|
106
|
-
"eslint": "^9.
|
|
107
|
-
"eslint-plugin-format": "^1.0.
|
|
102
|
+
"@types/node": "^24.5.2",
|
|
103
|
+
"@types/react": "^19.1.13",
|
|
104
|
+
"@unocss/eslint-plugin": "^66.5.2",
|
|
105
|
+
"bumpp": "^10.2.3",
|
|
106
|
+
"eslint": "^9.36.0",
|
|
107
|
+
"eslint-plugin-format": "^1.0.2",
|
|
108
108
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
109
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
110
|
-
"eslint-typegen": "^2.
|
|
109
|
+
"eslint-plugin-react-refresh": "^0.4.21",
|
|
110
|
+
"eslint-typegen": "^2.3.0",
|
|
111
111
|
"esno": "^4.8.0",
|
|
112
112
|
"execa": "^9.6.0",
|
|
113
|
-
"lint-staged": "^16.
|
|
113
|
+
"lint-staged": "^16.2.0",
|
|
114
114
|
"prettier": "^3.6.2",
|
|
115
|
-
"react": "^19.1.
|
|
116
|
-
"simple-git-hooks": "^2.13.
|
|
115
|
+
"react": "^19.1.1",
|
|
116
|
+
"simple-git-hooks": "^2.13.1",
|
|
117
117
|
"simple-open-url": "^3.0.1",
|
|
118
118
|
"sucrase": "^3.35.0",
|
|
119
|
-
"tinyglobby": "^0.2.
|
|
120
|
-
"tsdown": "^0.
|
|
121
|
-
"typescript": "^5.
|
|
119
|
+
"tinyglobby": "^0.2.15",
|
|
120
|
+
"tsdown": "^0.14.2",
|
|
121
|
+
"typescript": "^5.9.2",
|
|
122
122
|
"vitest": "^3.2.4",
|
|
123
|
-
"vue": "^3.5.
|
|
124
|
-
"@lincy/eslint-config": "5.
|
|
123
|
+
"vue": "^3.5.22",
|
|
124
|
+
"@lincy/eslint-config": "5.9.0"
|
|
125
125
|
},
|
|
126
126
|
"simple-git-hooks": {
|
|
127
127
|
"pre-commit": "npx lint-staged"
|