@lincy/eslint-config 7.1.2 → 7.2.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 +9 -17
- package/dist/index.d.cts +399 -155
- package/dist/index.d.mts +399 -155
- package/dist/index.mjs +9 -17
- package/package.json +16 -21
package/dist/index.mjs
CHANGED
|
@@ -295,6 +295,7 @@ function isInGitHooksOrLintStaged() {
|
|
|
295
295
|
//#endregion
|
|
296
296
|
//#region src/configs/stylistic.ts
|
|
297
297
|
const StylisticConfigDefaults = {
|
|
298
|
+
braceStyle: "stroustrup",
|
|
298
299
|
indent: 4,
|
|
299
300
|
jsx: true,
|
|
300
301
|
lessOpinionated: false,
|
|
@@ -304,12 +305,13 @@ const StylisticConfigDefaults = {
|
|
|
304
305
|
};
|
|
305
306
|
async function stylistic(options = {}) {
|
|
306
307
|
const { overrides = {}, stylistic = StylisticConfigDefaults } = options;
|
|
307
|
-
const { indent, jsx, lessOpinionated, quotes, semi } = typeof stylistic === "boolean" ? StylisticConfigDefaults : {
|
|
308
|
+
const { braceStyle, indent, jsx, lessOpinionated, quotes, semi } = typeof stylistic === "boolean" ? StylisticConfigDefaults : {
|
|
308
309
|
...StylisticConfigDefaults,
|
|
309
310
|
...stylistic
|
|
310
311
|
};
|
|
311
312
|
const pluginStylistic = await interopDefault(import("@stylistic/eslint-plugin"));
|
|
312
313
|
const config = pluginStylistic.configs.customize({
|
|
314
|
+
braceStyle,
|
|
313
315
|
indent,
|
|
314
316
|
jsx,
|
|
315
317
|
pluginName: "style",
|
|
@@ -1187,17 +1189,12 @@ async function react(options = {}) {
|
|
|
1187
1189
|
const isUsingRemix = RemixPackages.some((i) => isPackageExists(i));
|
|
1188
1190
|
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
|
|
1189
1191
|
const isUsingNext = NextJsPackages.some((i) => isPackageExists(i));
|
|
1190
|
-
const plugins = pluginReact.configs.all.plugins;
|
|
1191
1192
|
return [
|
|
1192
1193
|
{
|
|
1193
1194
|
name: "eslint/react/setup",
|
|
1194
1195
|
plugins: {
|
|
1195
|
-
"react": plugins["@eslint-react"],
|
|
1196
|
-
"react-
|
|
1197
|
-
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1198
|
-
"react-refresh": pluginReactRefresh,
|
|
1199
|
-
"react-rsc": plugins["@eslint-react/rsc"],
|
|
1200
|
-
"react-web-api": plugins["@eslint-react/web-api"]
|
|
1196
|
+
"react": pluginReact.configs.all.plugins["@eslint-react"],
|
|
1197
|
+
"react-refresh": pluginReactRefresh
|
|
1201
1198
|
}
|
|
1202
1199
|
},
|
|
1203
1200
|
{
|
|
@@ -1238,7 +1235,6 @@ async function react(options = {}) {
|
|
|
1238
1235
|
"shouldRevalidate"
|
|
1239
1236
|
] : []]
|
|
1240
1237
|
}],
|
|
1241
|
-
"react/prefer-namespace-import": "error",
|
|
1242
1238
|
...overrides
|
|
1243
1239
|
}
|
|
1244
1240
|
},
|
|
@@ -1246,8 +1242,8 @@ async function react(options = {}) {
|
|
|
1246
1242
|
files: filesTypeAware,
|
|
1247
1243
|
name: "eslint/react/typescript",
|
|
1248
1244
|
rules: {
|
|
1249
|
-
"react-
|
|
1250
|
-
"react-
|
|
1245
|
+
"react/dom-no-string-style-prop": "off",
|
|
1246
|
+
"react/dom-no-unknown-property": "off"
|
|
1251
1247
|
}
|
|
1252
1248
|
},
|
|
1253
1249
|
...isTypeAware ? [{
|
|
@@ -1787,7 +1783,7 @@ vueVersion = Number.isNaN(vueVersion) ? "3" : vueVersion;
|
|
|
1787
1783
|
async function vue(options = {}) {
|
|
1788
1784
|
const { files = [GLOB_VUE], overrides = {}, stylistic = true } = options;
|
|
1789
1785
|
const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
|
|
1790
|
-
const { indent = 4 } = typeof stylistic === "boolean" ? {} : stylistic;
|
|
1786
|
+
const { braceStyle = "stroustrup", indent = 4 } = typeof stylistic === "boolean" ? {} : stylistic;
|
|
1791
1787
|
const [pluginVue, parserVue, processorVueBlocks] = await Promise.all([
|
|
1792
1788
|
interopDefault(import("eslint-plugin-vue")),
|
|
1793
1789
|
interopDefault(import("vue-eslint-parser")),
|
|
@@ -1953,7 +1949,7 @@ async function vue(options = {}) {
|
|
|
1953
1949
|
}],
|
|
1954
1950
|
"vue/brace-style": [
|
|
1955
1951
|
"error",
|
|
1956
|
-
|
|
1952
|
+
braceStyle,
|
|
1957
1953
|
{ allowSingleLine: false }
|
|
1958
1954
|
],
|
|
1959
1955
|
"vue/comma-dangle": ["error", "always-multiline"],
|
|
@@ -2049,10 +2045,6 @@ const VuePackages = [
|
|
|
2049
2045
|
];
|
|
2050
2046
|
const defaultPluginRenaming = {
|
|
2051
2047
|
"@eslint-react": "react",
|
|
2052
|
-
"@eslint-react/dom": "react-dom",
|
|
2053
|
-
"@eslint-react/naming-convention": "react-naming-convention",
|
|
2054
|
-
"@eslint-react/rsc": "react-rsc",
|
|
2055
|
-
"@eslint-react/web-api": "react-web-api",
|
|
2056
2048
|
"@next/next": "next",
|
|
2057
2049
|
"@stylistic": "style",
|
|
2058
2050
|
"@typescript-eslint": "ts",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincy/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.2.0",
|
|
5
5
|
"description": "LinCenYing's ESLint config",
|
|
6
6
|
"author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -23,14 +23,13 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@eslint-react/eslint-plugin": "^
|
|
26
|
+
"@eslint-react/eslint-plugin": "^5.6.0",
|
|
27
27
|
"@next/eslint-plugin-next": ">=15.0.0",
|
|
28
28
|
"@prettier/plugin-xml": "^3.4.1",
|
|
29
29
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
30
30
|
"eslint": "^9.10.0 || ^10.0.0",
|
|
31
31
|
"eslint-plugin-format": ">=0.1.0",
|
|
32
|
-
"eslint-plugin-react-
|
|
33
|
-
"eslint-plugin-react-refresh": "^0.4.19"
|
|
32
|
+
"eslint-plugin-react-refresh": "^0.5.0"
|
|
34
33
|
},
|
|
35
34
|
"peerDependenciesMeta": {
|
|
36
35
|
"@eslint-react/eslint-plugin": {
|
|
@@ -48,9 +47,6 @@
|
|
|
48
47
|
"eslint-plugin-format": {
|
|
49
48
|
"optional": true
|
|
50
49
|
},
|
|
51
|
-
"eslint-plugin-react-hooks": {
|
|
52
|
-
"optional": true
|
|
53
|
-
},
|
|
54
50
|
"eslint-plugin-react-refresh": {
|
|
55
51
|
"optional": true
|
|
56
52
|
}
|
|
@@ -58,23 +54,23 @@
|
|
|
58
54
|
"dependencies": {
|
|
59
55
|
"@antfu/install-pkg": "^1.1.0",
|
|
60
56
|
"@clack/prompts": "^1.3.0",
|
|
61
|
-
"@e18e/eslint-plugin": "^0.
|
|
57
|
+
"@e18e/eslint-plugin": "^0.4.1",
|
|
62
58
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
63
59
|
"@eslint/markdown": "^8.0.1",
|
|
64
60
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^8.59.
|
|
66
|
-
"@typescript-eslint/parser": "^8.59.
|
|
67
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^8.59.3",
|
|
62
|
+
"@typescript-eslint/parser": "^8.59.3",
|
|
63
|
+
"@vitest/eslint-plugin": "^1.6.17",
|
|
68
64
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
69
65
|
"eslint-flat-config-utils": "^3.2.0",
|
|
70
66
|
"eslint-merge-processors": "^2.0.0",
|
|
71
67
|
"eslint-parser-plain": "^0.1.1",
|
|
72
|
-
"eslint-plugin-antfu": "^3.2.
|
|
68
|
+
"eslint-plugin-antfu": "^3.2.3",
|
|
73
69
|
"eslint-plugin-erasable-syntax-only": "^0.4.1",
|
|
74
70
|
"eslint-plugin-import-lite": "^0.6.0",
|
|
75
71
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
76
72
|
"eslint-plugin-jsonc": "^3.1.2",
|
|
77
|
-
"eslint-plugin-n": "^
|
|
73
|
+
"eslint-plugin-n": "^18.0.1",
|
|
78
74
|
"eslint-plugin-no-only-tests": "^3.4.0",
|
|
79
75
|
"eslint-plugin-perfectionist": "^5.9.0",
|
|
80
76
|
"eslint-plugin-pnpm": "^1.6.0",
|
|
@@ -94,33 +90,32 @@
|
|
|
94
90
|
},
|
|
95
91
|
"devDependencies": {
|
|
96
92
|
"@antfu/ni": "^30.1.0",
|
|
97
|
-
"@eslint-react/eslint-plugin": "^
|
|
93
|
+
"@eslint-react/eslint-plugin": "^5.6.0",
|
|
98
94
|
"@eslint/config-inspector": "^2.0.1",
|
|
99
|
-
"@next/eslint-plugin-next": "^16.2.
|
|
95
|
+
"@next/eslint-plugin-next": "^16.2.6",
|
|
100
96
|
"@prettier/plugin-xml": "^3.4.2",
|
|
101
97
|
"@stylistic/eslint-plugin-migrate": "^4.4.1",
|
|
102
|
-
"@types/node": "^25.
|
|
98
|
+
"@types/node": "^25.7.0",
|
|
103
99
|
"@types/react": "^19.2.14",
|
|
104
100
|
"@unocss/eslint-plugin": "^66.6.8",
|
|
105
101
|
"bumpp": "^11.1.0",
|
|
106
102
|
"eslint": "^10.3.0",
|
|
107
103
|
"eslint-plugin-format": "^2.0.1",
|
|
108
|
-
"eslint-plugin-react-hooks": "^7.1.1",
|
|
109
104
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
110
105
|
"eslint-typegen": "^2.3.1",
|
|
111
106
|
"esno": "^4.8.0",
|
|
112
107
|
"execa": "^9.6.1",
|
|
113
108
|
"find-up-simple": "^1.0.1",
|
|
114
|
-
"lint-staged": "^17.0.
|
|
109
|
+
"lint-staged": "^17.0.4",
|
|
115
110
|
"prettier": "^3.8.3",
|
|
116
111
|
"react": "^19.2.6",
|
|
117
112
|
"simple-open-url": "^3.0.1",
|
|
118
113
|
"tinyglobby": "^0.2.16",
|
|
119
|
-
"tsdown": "^0.
|
|
114
|
+
"tsdown": "^0.22.0",
|
|
120
115
|
"typescript": "^6.0.3",
|
|
121
|
-
"vitest": "^4.1.
|
|
116
|
+
"vitest": "^4.1.6",
|
|
122
117
|
"vue": "^3.5.34",
|
|
123
|
-
"@lincy/eslint-config": "7.
|
|
118
|
+
"@lincy/eslint-config": "7.2.0"
|
|
124
119
|
},
|
|
125
120
|
"resolutions": {
|
|
126
121
|
"@eslint-community/eslint-utils": "catalog:peer",
|