@lincy/eslint-config 5.4.2 → 5.5.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 +4 -2
- package/dist/index.cjs +72 -8
- package/dist/index.d.cts +1232 -316
- package/dist/index.d.ts +1232 -316
- package/dist/index.js +70 -7
- package/package.json +36 -38
package/dist/index.js
CHANGED
|
@@ -307,7 +307,9 @@ async function stylistic(options = {}) {
|
|
|
307
307
|
},
|
|
308
308
|
// 覆盖`stylistic`默认规则
|
|
309
309
|
"style/brace-style": ["error", "stroustrup"],
|
|
310
|
+
"style/generator-star-spacing": ["error", { after: true, before: false }],
|
|
310
311
|
"style/multiline-ternary": ["error", "never"],
|
|
312
|
+
"style/yield-star-spacing": ["error", { after: true, before: false }],
|
|
311
313
|
...overrides
|
|
312
314
|
}
|
|
313
315
|
}
|
|
@@ -1088,6 +1090,30 @@ async function perfectionist(options = {}) {
|
|
|
1088
1090
|
];
|
|
1089
1091
|
}
|
|
1090
1092
|
|
|
1093
|
+
// src/configs/pnpm.ts
|
|
1094
|
+
async function pnpm() {
|
|
1095
|
+
return [
|
|
1096
|
+
{
|
|
1097
|
+
files: [
|
|
1098
|
+
"package.json",
|
|
1099
|
+
"**/package.json"
|
|
1100
|
+
],
|
|
1101
|
+
languageOptions: {
|
|
1102
|
+
parser: await interopDefault(import("jsonc-eslint-parser"))
|
|
1103
|
+
},
|
|
1104
|
+
name: "eslint/pnpm/rules",
|
|
1105
|
+
plugins: {
|
|
1106
|
+
pnpm: await interopDefault(import("eslint-plugin-pnpm"))
|
|
1107
|
+
},
|
|
1108
|
+
rules: {
|
|
1109
|
+
"pnpm/enforce-catalog": "error",
|
|
1110
|
+
"pnpm/prefer-workspace-settings": "error",
|
|
1111
|
+
"pnpm/valid-catalog": "error"
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
];
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1091
1117
|
// src/configs/react.ts
|
|
1092
1118
|
import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
1093
1119
|
var ReactRefreshAllowConstantExportPackages = [
|
|
@@ -1133,7 +1159,6 @@ async function react(options = {}) {
|
|
|
1133
1159
|
pluginReactRefresh
|
|
1134
1160
|
] = await Promise.all([
|
|
1135
1161
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1136
|
-
// @ts-expect-error missing types
|
|
1137
1162
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1138
1163
|
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1139
1164
|
]);
|
|
@@ -1954,13 +1979,13 @@ async function vue(options = {}) {
|
|
|
1954
1979
|
rules: {
|
|
1955
1980
|
...pluginVue.configs.base.rules,
|
|
1956
1981
|
...vueVersion === "2" ? {
|
|
1957
|
-
...pluginVue.configs
|
|
1958
|
-
...pluginVue.configs["strongly-recommended"].rules,
|
|
1959
|
-
...pluginVue.configs
|
|
1982
|
+
...pluginVue.configs["vue2-essential"].rules,
|
|
1983
|
+
...pluginVue.configs["vue2-strongly-recommended"].rules,
|
|
1984
|
+
...pluginVue.configs["vue2-recommended"].rules
|
|
1960
1985
|
} : {
|
|
1961
|
-
...pluginVue.configs["
|
|
1962
|
-
...pluginVue.configs["
|
|
1963
|
-
...pluginVue.configs["
|
|
1986
|
+
...pluginVue.configs["flat/essential"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
1987
|
+
...pluginVue.configs["flat/strongly-recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
1988
|
+
...pluginVue.configs["flat/recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {})
|
|
1964
1989
|
},
|
|
1965
1990
|
"antfu/no-top-level-await": "off",
|
|
1966
1991
|
"node/prefer-global/process": "off",
|
|
@@ -2127,6 +2152,37 @@ async function yaml(options = {}) {
|
|
|
2127
2152
|
} : {},
|
|
2128
2153
|
...overrides
|
|
2129
2154
|
}
|
|
2155
|
+
},
|
|
2156
|
+
{
|
|
2157
|
+
files: ["pnpm-workspace.yaml"],
|
|
2158
|
+
name: "eslint/yaml/pnpm-workspace",
|
|
2159
|
+
rules: {
|
|
2160
|
+
"yaml/sort-keys": [
|
|
2161
|
+
"error",
|
|
2162
|
+
{
|
|
2163
|
+
order: [
|
|
2164
|
+
"packages",
|
|
2165
|
+
"overrides",
|
|
2166
|
+
"patchedDependencies",
|
|
2167
|
+
"hoistPattern",
|
|
2168
|
+
"catalog",
|
|
2169
|
+
"catalogs",
|
|
2170
|
+
"allowedDeprecatedVersions",
|
|
2171
|
+
"allowNonAppliedPatches",
|
|
2172
|
+
"configDependencies",
|
|
2173
|
+
"ignoredBuiltDependencies",
|
|
2174
|
+
"ignoredOptionalDependencies",
|
|
2175
|
+
"neverBuiltDependencies",
|
|
2176
|
+
"onlyBuiltDependencies",
|
|
2177
|
+
"onlyBuiltDependenciesFile",
|
|
2178
|
+
"packageExtensions",
|
|
2179
|
+
"peerDependencyRules",
|
|
2180
|
+
"supportedArchitectures"
|
|
2181
|
+
],
|
|
2182
|
+
pathPattern: "^$"
|
|
2183
|
+
}
|
|
2184
|
+
]
|
|
2185
|
+
}
|
|
2130
2186
|
}
|
|
2131
2187
|
];
|
|
2132
2188
|
}
|
|
@@ -2167,6 +2223,7 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
2167
2223
|
ignores: ignoresList = [],
|
|
2168
2224
|
jsx: enableJsx = true,
|
|
2169
2225
|
overrides = {},
|
|
2226
|
+
pnpm: enableCatalogs = false,
|
|
2170
2227
|
react: enableReact = false,
|
|
2171
2228
|
regexp: enableRegexp = true,
|
|
2172
2229
|
typescript: enableTypeScript = isPackageExists3("typescript"),
|
|
@@ -2302,6 +2359,11 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
2302
2359
|
sortTsconfig()
|
|
2303
2360
|
);
|
|
2304
2361
|
}
|
|
2362
|
+
if (enableCatalogs) {
|
|
2363
|
+
configs2.push(
|
|
2364
|
+
pnpm()
|
|
2365
|
+
);
|
|
2366
|
+
}
|
|
2305
2367
|
if (options.yaml ?? true) {
|
|
2306
2368
|
configs2.push(yaml({
|
|
2307
2369
|
...resolveSubOptions(options, "yaml"),
|
|
@@ -2430,6 +2492,7 @@ export {
|
|
|
2430
2492
|
node,
|
|
2431
2493
|
parserPlain,
|
|
2432
2494
|
perfectionist,
|
|
2495
|
+
pnpm,
|
|
2433
2496
|
react,
|
|
2434
2497
|
regexp,
|
|
2435
2498
|
renamePluginInConfigs,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincy/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
4
|
+
"version": "5.5.0",
|
|
5
|
+
"packageManager": "pnpm@10.6.1",
|
|
6
6
|
"description": "LinCenYing's ESLint config",
|
|
7
7
|
"author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
|
|
8
8
|
"license": "MIT",
|
|
@@ -70,72 +70,70 @@
|
|
|
70
70
|
"@antfu/install-pkg": "^1.0.0",
|
|
71
71
|
"@clack/prompts": "^0.10.0",
|
|
72
72
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
73
|
-
"@eslint/markdown": "^6.
|
|
73
|
+
"@eslint/markdown": "^6.3.0",
|
|
74
74
|
"@stylistic/eslint-plugin": "4.0.0-beta.1",
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
76
|
-
"@typescript-eslint/parser": "^8.
|
|
77
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
78
|
-
"eslint-config-flat-gitignore": "^2.
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^8.26.0",
|
|
76
|
+
"@typescript-eslint/parser": "^8.26.0",
|
|
77
|
+
"@vitest/eslint-plugin": "^1.1.36",
|
|
78
|
+
"eslint-config-flat-gitignore": "^2.1.0",
|
|
79
79
|
"eslint-flat-config-utils": "^2.0.1",
|
|
80
80
|
"eslint-merge-processors": "^2.0.0",
|
|
81
81
|
"eslint-parser-plain": "^0.1.1",
|
|
82
|
-
"eslint-plugin-antfu": "^3.
|
|
82
|
+
"eslint-plugin-antfu": "^3.1.1",
|
|
83
83
|
"eslint-plugin-import-x": "^4.6.1",
|
|
84
84
|
"eslint-plugin-jsdoc": "^50.6.3",
|
|
85
85
|
"eslint-plugin-jsonc": "^2.19.1",
|
|
86
|
-
"eslint-plugin-n": "^17.
|
|
86
|
+
"eslint-plugin-n": "^17.16.2",
|
|
87
87
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
88
|
-
"eslint-plugin-perfectionist": "^4.
|
|
88
|
+
"eslint-plugin-perfectionist": "^4.10.1",
|
|
89
|
+
"eslint-plugin-pnpm": "^0.1.2",
|
|
89
90
|
"eslint-plugin-regexp": "^2.7.0",
|
|
90
91
|
"eslint-plugin-toml": "^0.12.0",
|
|
91
|
-
"eslint-plugin-unicorn": "
|
|
92
|
+
"eslint-plugin-unicorn": "56.0.1",
|
|
92
93
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
93
|
-
"eslint-plugin-vue": "^
|
|
94
|
-
"eslint-plugin-yml": "^1.
|
|
94
|
+
"eslint-plugin-vue": "^10.0.0",
|
|
95
|
+
"eslint-plugin-yml": "^1.17.0",
|
|
95
96
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
96
|
-
"globals": "^
|
|
97
|
+
"globals": "^16.0.0",
|
|
97
98
|
"jsonc-eslint-parser": "^2.4.0",
|
|
98
|
-
"local-pkg": "^1.
|
|
99
|
+
"local-pkg": "^1.1.1",
|
|
99
100
|
"prompts": "^2.4.2",
|
|
100
101
|
"toml-eslint-parser": "^0.10.0",
|
|
101
|
-
"vue-eslint-parser": "^
|
|
102
|
-
"yaml-eslint-parser": "^1.
|
|
102
|
+
"vue-eslint-parser": "^10.1.1",
|
|
103
|
+
"yaml-eslint-parser": "^1.3.0"
|
|
103
104
|
},
|
|
104
105
|
"devDependencies": {
|
|
105
106
|
"@antfu/ni": "^23.3.1",
|
|
106
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
107
|
+
"@eslint-react/eslint-plugin": "^1.31.0",
|
|
107
108
|
"@eslint-types/jsdoc": "48.2.2",
|
|
108
109
|
"@eslint-types/typescript-eslint": "^7.5.0",
|
|
109
110
|
"@eslint-types/unicorn": "^52.0.0",
|
|
110
|
-
"@eslint/config-inspector": "^1.0.
|
|
111
|
+
"@eslint/config-inspector": "^1.0.2",
|
|
111
112
|
"@lincy/eslint-config": "workspace:*",
|
|
112
113
|
"@prettier/plugin-xml": "^3.4.1",
|
|
113
|
-
"@stylistic/eslint-plugin-migrate": "^4.
|
|
114
|
-
"@types/
|
|
115
|
-
"@types/
|
|
116
|
-
"@
|
|
117
|
-
"@types/react": "^19.0.8",
|
|
118
|
-
"@unocss/eslint-plugin": "^65.4.3",
|
|
114
|
+
"@stylistic/eslint-plugin-migrate": "^4.2.0",
|
|
115
|
+
"@types/node": "^22.13.10",
|
|
116
|
+
"@types/react": "^19.0.10",
|
|
117
|
+
"@unocss/eslint-plugin": "^66.1.0-beta.3",
|
|
119
118
|
"bumpp": "^10.0.3",
|
|
120
|
-
"eslint": "^9.
|
|
119
|
+
"eslint": "^9.22.0",
|
|
121
120
|
"eslint-plugin-format": "^1.0.1",
|
|
122
|
-
"eslint-plugin-react-hooks": "^5.
|
|
121
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
123
122
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
124
123
|
"eslint-ts-patch": "9.8.0-1",
|
|
125
|
-
"eslint-typegen": "^
|
|
124
|
+
"eslint-typegen": "^2.0.0",
|
|
126
125
|
"esno": "^4.8.0",
|
|
127
|
-
"fs-extra": "^11.3.0",
|
|
128
126
|
"lint-staged": "^15.4.3",
|
|
129
|
-
"prettier": "^3.5.
|
|
127
|
+
"prettier": "^3.5.3",
|
|
130
128
|
"react": "^19.0.0",
|
|
131
|
-
"rimraf": "^6.0.1",
|
|
132
129
|
"simple-git-hooks": "^2.11.1",
|
|
133
130
|
"simple-open-url": "^3.0.1",
|
|
134
131
|
"sucrase": "^3.35.0",
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
132
|
+
"tinyglobby": "^0.2.12",
|
|
133
|
+
"tsup": "^8.4.0",
|
|
134
|
+
"typescript": "^5.8.2",
|
|
135
|
+
"unbuild": "^3.5.0",
|
|
136
|
+
"vitest": "^3.0.8",
|
|
139
137
|
"vue": "^3.5.13"
|
|
140
138
|
},
|
|
141
139
|
"pnpm": {
|
|
@@ -147,9 +145,9 @@
|
|
|
147
145
|
},
|
|
148
146
|
"resolutions": {
|
|
149
147
|
"@eslint-community/eslint-utils": "^4.4.1",
|
|
150
|
-
"@typescript-eslint/utils": "^8.
|
|
151
|
-
"eslint": "^9.
|
|
152
|
-
"tsx": "^4.19.
|
|
148
|
+
"@typescript-eslint/utils": "^8.26.0",
|
|
149
|
+
"eslint": "^9.22.0",
|
|
150
|
+
"tsx": "^4.19.3"
|
|
153
151
|
},
|
|
154
152
|
"simple-git-hooks": {
|
|
155
153
|
"pre-commit": "npx lint-staged"
|