@lincy/eslint-config 5.4.1 → 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 +79 -14
- package/dist/index.d.cts +1293 -348
- package/dist/index.d.ts +1293 -348
- package/dist/index.js +74 -10
- package/package.json +47 -49
package/dist/index.js
CHANGED
|
@@ -281,7 +281,6 @@ async function stylistic(options = {}) {
|
|
|
281
281
|
} = typeof stylistic2 === "boolean" ? StylisticConfigDefaults : { ...StylisticConfigDefaults, ...stylistic2 };
|
|
282
282
|
const pluginStylistic = await interopDefault(import("@stylistic/eslint-plugin"));
|
|
283
283
|
const config = pluginStylistic.configs.customize({
|
|
284
|
-
flat: true,
|
|
285
284
|
indent,
|
|
286
285
|
jsx: jsx2,
|
|
287
286
|
pluginName: "style",
|
|
@@ -308,7 +307,9 @@ async function stylistic(options = {}) {
|
|
|
308
307
|
},
|
|
309
308
|
// 覆盖`stylistic`默认规则
|
|
310
309
|
"style/brace-style": ["error", "stroustrup"],
|
|
310
|
+
"style/generator-star-spacing": ["error", { after: true, before: false }],
|
|
311
311
|
"style/multiline-ternary": ["error", "never"],
|
|
312
|
+
"style/yield-star-spacing": ["error", { after: true, before: false }],
|
|
312
313
|
...overrides
|
|
313
314
|
}
|
|
314
315
|
}
|
|
@@ -578,6 +579,7 @@ async function imports(options = {}) {
|
|
|
578
579
|
"antfu/import-dedupe": "error",
|
|
579
580
|
"antfu/no-import-dist": "error",
|
|
580
581
|
"antfu/no-import-node-modules-by-path": "error",
|
|
582
|
+
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
581
583
|
"import/first": "error",
|
|
582
584
|
"import/no-duplicates": "error",
|
|
583
585
|
"import/no-mutable-exports": "error",
|
|
@@ -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
|
]);
|
|
@@ -1745,6 +1770,7 @@ async function typescript(options = {}) {
|
|
|
1745
1770
|
"ts/consistent-type-definitions": ["error", "interface"],
|
|
1746
1771
|
"ts/consistent-type-imports": ["error", {
|
|
1747
1772
|
disallowTypeAnnotations: false,
|
|
1773
|
+
fixStyle: "separate-type-imports",
|
|
1748
1774
|
prefer: "type-imports"
|
|
1749
1775
|
}],
|
|
1750
1776
|
"ts/method-signature-style": ["error", "property"],
|
|
@@ -1953,13 +1979,13 @@ async function vue(options = {}) {
|
|
|
1953
1979
|
rules: {
|
|
1954
1980
|
...pluginVue.configs.base.rules,
|
|
1955
1981
|
...vueVersion === "2" ? {
|
|
1956
|
-
...pluginVue.configs
|
|
1957
|
-
...pluginVue.configs["strongly-recommended"].rules,
|
|
1958
|
-
...pluginVue.configs
|
|
1982
|
+
...pluginVue.configs["vue2-essential"].rules,
|
|
1983
|
+
...pluginVue.configs["vue2-strongly-recommended"].rules,
|
|
1984
|
+
...pluginVue.configs["vue2-recommended"].rules
|
|
1959
1985
|
} : {
|
|
1960
|
-
...pluginVue.configs["
|
|
1961
|
-
...pluginVue.configs["
|
|
1962
|
-
...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 }), {})
|
|
1963
1989
|
},
|
|
1964
1990
|
"antfu/no-top-level-await": "off",
|
|
1965
1991
|
"node/prefer-global/process": "off",
|
|
@@ -2126,6 +2152,37 @@ async function yaml(options = {}) {
|
|
|
2126
2152
|
} : {},
|
|
2127
2153
|
...overrides
|
|
2128
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
|
+
}
|
|
2129
2186
|
}
|
|
2130
2187
|
];
|
|
2131
2188
|
}
|
|
@@ -2166,6 +2223,7 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
2166
2223
|
ignores: ignoresList = [],
|
|
2167
2224
|
jsx: enableJsx = true,
|
|
2168
2225
|
overrides = {},
|
|
2226
|
+
pnpm: enableCatalogs = false,
|
|
2169
2227
|
react: enableReact = false,
|
|
2170
2228
|
regexp: enableRegexp = true,
|
|
2171
2229
|
typescript: enableTypeScript = isPackageExists3("typescript"),
|
|
@@ -2301,6 +2359,11 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
2301
2359
|
sortTsconfig()
|
|
2302
2360
|
);
|
|
2303
2361
|
}
|
|
2362
|
+
if (enableCatalogs) {
|
|
2363
|
+
configs2.push(
|
|
2364
|
+
pnpm()
|
|
2365
|
+
);
|
|
2366
|
+
}
|
|
2304
2367
|
if (options.yaml ?? true) {
|
|
2305
2368
|
configs2.push(yaml({
|
|
2306
2369
|
...resolveSubOptions(options, "yaml"),
|
|
@@ -2375,7 +2438,7 @@ function getOverrides(options, key) {
|
|
|
2375
2438
|
}
|
|
2376
2439
|
|
|
2377
2440
|
// src/index.ts
|
|
2378
|
-
var
|
|
2441
|
+
var index_default = lincy;
|
|
2379
2442
|
export {
|
|
2380
2443
|
GLOB_ALL_SRC,
|
|
2381
2444
|
GLOB_CSS,
|
|
@@ -2408,7 +2471,7 @@ export {
|
|
|
2408
2471
|
StylisticConfigDefaults,
|
|
2409
2472
|
combine,
|
|
2410
2473
|
comments,
|
|
2411
|
-
|
|
2474
|
+
index_default as default,
|
|
2412
2475
|
defaultPluginRenaming,
|
|
2413
2476
|
disables,
|
|
2414
2477
|
ensurePackages,
|
|
@@ -2429,6 +2492,7 @@ export {
|
|
|
2429
2492
|
node,
|
|
2430
2493
|
parserPlain,
|
|
2431
2494
|
perfectionist,
|
|
2495
|
+
pnpm,
|
|
2432
2496
|
react,
|
|
2433
2497
|
regexp,
|
|
2434
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@
|
|
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",
|
|
@@ -68,74 +68,72 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@antfu/eslint-define-config": "1.23.0-2",
|
|
70
70
|
"@antfu/install-pkg": "^1.0.0",
|
|
71
|
-
"@clack/prompts": "^0.
|
|
71
|
+
"@clack/prompts": "^0.10.0",
|
|
72
72
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
73
|
-
"@eslint/markdown": "^6.
|
|
74
|
-
"@stylistic/eslint-plugin": "
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
76
|
-
"@typescript-eslint/parser": "^8.
|
|
77
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
78
|
-
"eslint-config-flat-gitignore": "^1.0
|
|
79
|
-
"eslint-flat-config-utils": "^
|
|
80
|
-
"eslint-merge-processors": "^
|
|
73
|
+
"@eslint/markdown": "^6.3.0",
|
|
74
|
+
"@stylistic/eslint-plugin": "4.0.0-beta.1",
|
|
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
|
+
"eslint-flat-config-utils": "^2.0.1",
|
|
80
|
+
"eslint-merge-processors": "^2.0.0",
|
|
81
81
|
"eslint-parser-plain": "^0.1.1",
|
|
82
|
-
"eslint-plugin-antfu": "^
|
|
82
|
+
"eslint-plugin-antfu": "^3.1.1",
|
|
83
83
|
"eslint-plugin-import-x": "^4.6.1",
|
|
84
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
85
|
-
"eslint-plugin-jsonc": "^2.
|
|
86
|
-
"eslint-plugin-n": "^17.
|
|
84
|
+
"eslint-plugin-jsdoc": "^50.6.3",
|
|
85
|
+
"eslint-plugin-jsonc": "^2.19.1",
|
|
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.
|
|
95
|
-
"eslint-processor-vue-blocks": "^
|
|
96
|
-
"globals": "^
|
|
94
|
+
"eslint-plugin-vue": "^10.0.0",
|
|
95
|
+
"eslint-plugin-yml": "^1.17.0",
|
|
96
|
+
"eslint-processor-vue-blocks": "^2.0.0",
|
|
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
|
-
"@antfu/ni": "^23.
|
|
106
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
106
|
+
"@antfu/ni": "^23.3.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": "^2.
|
|
114
|
-
"@types/
|
|
115
|
-
"@types/
|
|
116
|
-
"@
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"bumpp": "^9.10.2",
|
|
120
|
-
"eslint": "^9.18.0",
|
|
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",
|
|
118
|
+
"bumpp": "^10.0.3",
|
|
119
|
+
"eslint": "^9.22.0",
|
|
121
120
|
"eslint-plugin-format": "^1.0.1",
|
|
122
|
-
"eslint-plugin-react-hooks": "^5.
|
|
123
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
121
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
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
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"prettier": "^3.4.2",
|
|
126
|
+
"lint-staged": "^15.4.3",
|
|
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"
|