@lincy/eslint-config 5.6.1 → 5.7.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/README.md +1 -1
- package/dist/index.cjs +15 -12
- package/dist/index.d.cts +282 -629
- package/dist/index.d.ts +282 -629
- package/dist/index.js +15 -12
- package/package.json +28 -28
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
|
2
2
|
import { getPackageInfoSync, isPackageExists } from "local-pkg";
|
|
3
3
|
import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
4
4
|
import pluginAntfu from "eslint-plugin-antfu";
|
|
5
|
-
import
|
|
5
|
+
import pluginImportLite from "eslint-plugin-import-lite";
|
|
6
6
|
import pluginNode from "eslint-plugin-n";
|
|
7
7
|
import pluginPerfectionist from "eslint-plugin-perfectionist";
|
|
8
8
|
import pluginUnicorn from "eslint-plugin-unicorn";
|
|
@@ -436,7 +436,7 @@ async function imports(options = {}) {
|
|
|
436
436
|
name: "eslint/imports/rules",
|
|
437
437
|
plugins: {
|
|
438
438
|
antfu: pluginAntfu,
|
|
439
|
-
import:
|
|
439
|
+
import: pluginImportLite
|
|
440
440
|
},
|
|
441
441
|
rules: {
|
|
442
442
|
"antfu/import-dedupe": "error",
|
|
@@ -447,12 +447,7 @@ async function imports(options = {}) {
|
|
|
447
447
|
"import/no-duplicates": "error",
|
|
448
448
|
"import/no-mutable-exports": "error",
|
|
449
449
|
"import/no-named-default": "error",
|
|
450
|
-
"import/
|
|
451
|
-
"import/no-webpack-loader-syntax": "error",
|
|
452
|
-
...stylistic$1 ? { "import/newline-after-import": ["error", {
|
|
453
|
-
considerComments: true,
|
|
454
|
-
count: 1
|
|
455
|
-
}] } : {},
|
|
450
|
+
...stylistic$1 ? { "import/newline-after-import": ["error", { count: 1 }] } : {},
|
|
456
451
|
...overrides
|
|
457
452
|
}
|
|
458
453
|
}];
|
|
@@ -1068,7 +1063,11 @@ async function react(options = {}) {
|
|
|
1068
1063
|
"links",
|
|
1069
1064
|
"headers",
|
|
1070
1065
|
"loader",
|
|
1071
|
-
"action"
|
|
1066
|
+
"action",
|
|
1067
|
+
"clientLoader",
|
|
1068
|
+
"clientAction",
|
|
1069
|
+
"handle",
|
|
1070
|
+
"shouldRevalidate"
|
|
1072
1071
|
] : []]
|
|
1073
1072
|
}],
|
|
1074
1073
|
"react-web-api/no-leaked-event-listener": "warn",
|
|
@@ -1256,7 +1255,7 @@ async function sortPackageJson() {
|
|
|
1256
1255
|
*/
|
|
1257
1256
|
function sortTsconfig() {
|
|
1258
1257
|
return [{
|
|
1259
|
-
files: ["**/
|
|
1258
|
+
files: ["**/[jt]sconfig.json", "**/[jt]sconfig.*.json"],
|
|
1260
1259
|
name: "eslint/sort/tsconfig",
|
|
1261
1260
|
rules: { "jsonc/sort-keys": [
|
|
1262
1261
|
"error",
|
|
@@ -1948,7 +1947,7 @@ const defaultPluginRenaming = {
|
|
|
1948
1947
|
"@eslint-react/naming-convention": "react-naming-convention",
|
|
1949
1948
|
"@stylistic": "style",
|
|
1950
1949
|
"@typescript-eslint": "ts",
|
|
1951
|
-
"import-
|
|
1950
|
+
"import-lite": "import",
|
|
1952
1951
|
"n": "node",
|
|
1953
1952
|
"vitest": "test",
|
|
1954
1953
|
"yml": "yaml"
|
|
@@ -1964,7 +1963,7 @@ const defaultPluginRenaming = {
|
|
|
1964
1963
|
* 合并的 ESLint 配置
|
|
1965
1964
|
*/
|
|
1966
1965
|
function lincy(options = {}, ...userConfigs) {
|
|
1967
|
-
const { autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, ignores: ignoresList = [], jsx: enableJsx = true, overrides = {}, pnpm: enableCatalogs = false, react: enableReact = false, regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
1966
|
+
const { autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, ignores: ignoresList = [], imports: enableImports = true, jsx: enableJsx = true, overrides = {}, pnpm: enableCatalogs = false, react: enableReact = false, regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
1968
1967
|
let isInEditor = options.isInEditor;
|
|
1969
1968
|
if (isInEditor == null) {
|
|
1970
1969
|
isInEditor = isInEditorEnv();
|
|
@@ -1997,6 +1996,10 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
1997
1996
|
...enableUnicorn === true ? {} : enableUnicorn,
|
|
1998
1997
|
overrides: overrides.unicorn
|
|
1999
1998
|
}));
|
|
1999
|
+
if (enableImports) configs$1.push(imports({
|
|
2000
|
+
overrides: overrides.imports,
|
|
2001
|
+
stylistic: stylisticOptions
|
|
2002
|
+
}));
|
|
2000
2003
|
if (enableVue) componentExts.push("vue");
|
|
2001
2004
|
if (enableJsx) configs$1.push(jsx());
|
|
2002
2005
|
if (enableTypeScript) configs$1.push(typescript({
|
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.7.1",
|
|
5
5
|
"description": "LinCenYing's ESLint config",
|
|
6
6
|
"author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -54,69 +54,69 @@
|
|
|
54
54
|
"@antfu/install-pkg": "^1.1.0",
|
|
55
55
|
"@clack/prompts": "^0.11.0",
|
|
56
56
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
57
|
-
"@eslint/markdown": "^
|
|
58
|
-
"@stylistic/eslint-plugin": "^
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
60
|
-
"@typescript-eslint/parser": "^8.
|
|
61
|
-
"@vitest/eslint-plugin": "^1.
|
|
57
|
+
"@eslint/markdown": "^7.0.0",
|
|
58
|
+
"@stylistic/eslint-plugin": "^5.1.0",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^8.37.0",
|
|
60
|
+
"@typescript-eslint/parser": "^8.37.0",
|
|
61
|
+
"@vitest/eslint-plugin": "^1.3.4",
|
|
62
62
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
63
63
|
"eslint-flat-config-utils": "^2.1.0",
|
|
64
64
|
"eslint-merge-processors": "^2.0.0",
|
|
65
65
|
"eslint-parser-plain": "^0.1.1",
|
|
66
66
|
"eslint-plugin-antfu": "^3.1.1",
|
|
67
|
-
"eslint-plugin-import-
|
|
68
|
-
"eslint-plugin-jsdoc": "^
|
|
67
|
+
"eslint-plugin-import-lite": "^0.3.0",
|
|
68
|
+
"eslint-plugin-jsdoc": "^51.3.4",
|
|
69
69
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
70
|
-
"eslint-plugin-n": "^17.
|
|
70
|
+
"eslint-plugin-n": "^17.21.0",
|
|
71
71
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
72
|
-
"eslint-plugin-perfectionist": "^4.
|
|
73
|
-
"eslint-plugin-pnpm": "^0.
|
|
72
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
73
|
+
"eslint-plugin-pnpm": "^1.0.0",
|
|
74
74
|
"eslint-plugin-regexp": "^2.9.0",
|
|
75
75
|
"eslint-plugin-toml": "^0.12.0",
|
|
76
76
|
"eslint-plugin-unicorn": "^59.0.1",
|
|
77
77
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
78
|
-
"eslint-plugin-vue": "^10.
|
|
78
|
+
"eslint-plugin-vue": "^10.3.0",
|
|
79
79
|
"eslint-plugin-yml": "^1.18.0",
|
|
80
80
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
81
|
-
"globals": "^16.
|
|
81
|
+
"globals": "^16.3.0",
|
|
82
82
|
"jsonc-eslint-parser": "^2.4.0",
|
|
83
83
|
"local-pkg": "^1.1.1",
|
|
84
84
|
"prompts": "^2.4.2",
|
|
85
85
|
"toml-eslint-parser": "^0.10.0",
|
|
86
|
-
"vue-eslint-parser": "^10.
|
|
86
|
+
"vue-eslint-parser": "^10.2.0",
|
|
87
87
|
"yaml-eslint-parser": "^1.3.0"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@antfu/ni": "^25.0.0",
|
|
91
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
91
|
+
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
92
92
|
"@eslint-types/typescript-eslint": "^7.5.0",
|
|
93
93
|
"@eslint-types/unicorn": "^52.0.0",
|
|
94
94
|
"@eslint/config-inspector": "^1.1.0",
|
|
95
|
-
"@prettier/plugin-xml": "^3.4.
|
|
95
|
+
"@prettier/plugin-xml": "^3.4.2",
|
|
96
96
|
"@stylistic/eslint-plugin-migrate": "^4.4.1",
|
|
97
|
-
"@types/node": "^24.0.
|
|
98
|
-
"@types/react": "^19.1.
|
|
99
|
-
"@unocss/eslint-plugin": "^66.
|
|
100
|
-
"bumpp": "^10.
|
|
101
|
-
"eslint": "^9.
|
|
97
|
+
"@types/node": "^24.0.13",
|
|
98
|
+
"@types/react": "^19.1.8",
|
|
99
|
+
"@unocss/eslint-plugin": "^66.3.3",
|
|
100
|
+
"bumpp": "^10.2.0",
|
|
101
|
+
"eslint": "^9.31.0",
|
|
102
102
|
"eslint-plugin-format": "^1.0.1",
|
|
103
103
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
104
104
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
105
|
-
"eslint-typegen": "^2.2.
|
|
105
|
+
"eslint-typegen": "^2.2.1",
|
|
106
106
|
"esno": "^4.8.0",
|
|
107
107
|
"execa": "^9.6.0",
|
|
108
|
-
"lint-staged": "^16.1.
|
|
109
|
-
"prettier": "^3.
|
|
108
|
+
"lint-staged": "^16.1.2",
|
|
109
|
+
"prettier": "^3.6.2",
|
|
110
110
|
"react": "^19.1.0",
|
|
111
111
|
"simple-git-hooks": "^2.13.0",
|
|
112
112
|
"simple-open-url": "^3.0.1",
|
|
113
113
|
"sucrase": "^3.35.0",
|
|
114
114
|
"tinyglobby": "^0.2.14",
|
|
115
|
-
"tsdown": "^0.12.
|
|
115
|
+
"tsdown": "^0.12.9",
|
|
116
116
|
"typescript": "^5.8.3",
|
|
117
|
-
"vitest": "^3.2.
|
|
118
|
-
"vue": "^3.5.
|
|
119
|
-
"@lincy/eslint-config": "5.
|
|
117
|
+
"vitest": "^3.2.4",
|
|
118
|
+
"vue": "^3.5.17",
|
|
119
|
+
"@lincy/eslint-config": "5.7.1"
|
|
120
120
|
},
|
|
121
121
|
"simple-git-hooks": {
|
|
122
122
|
"pre-commit": "npx lint-staged"
|