@liwo/eslint-config 0.0.4 → 0.0.6
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.d.ts +326 -203
- package/dist/index.js +5 -9
- package/package.json +45 -61
package/dist/index.js
CHANGED
|
@@ -197,8 +197,7 @@ const parserPlain = {
|
|
|
197
197
|
* Combine array and non-array configs into a single array.
|
|
198
198
|
*/
|
|
199
199
|
async function combine(...configs$1) {
|
|
200
|
-
|
|
201
|
-
return resolved.flat();
|
|
200
|
+
return (await Promise.all(configs$1)).flat();
|
|
202
201
|
}
|
|
203
202
|
/**
|
|
204
203
|
* Rename plugin prefixes in a rule object.
|
|
@@ -263,9 +262,7 @@ async function ensurePackages(packages) {
|
|
|
263
262
|
if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false) return;
|
|
264
263
|
const nonExistingPackages = packages.filter((i) => i && !isPackageInScope(i));
|
|
265
264
|
if (nonExistingPackages.length === 0) return;
|
|
266
|
-
|
|
267
|
-
const result = await p.confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` });
|
|
268
|
-
if (result) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
265
|
+
if (await (await import("@clack/prompts")).confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` })) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
269
266
|
}
|
|
270
267
|
function isInEditorEnv() {
|
|
271
268
|
if (process.env.CI) return false;
|
|
@@ -378,10 +375,9 @@ async function formatters(options = {}, stylistic$1 = {}) {
|
|
|
378
375
|
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
379
376
|
useTabs: indent === "tab"
|
|
380
377
|
}, options.dprintOptions || {});
|
|
381
|
-
const pluginFormat = await interopDefault(import("eslint-plugin-format"));
|
|
382
378
|
const configs$1 = [{
|
|
383
379
|
name: "liwo/formatter/setup",
|
|
384
|
-
plugins: { format:
|
|
380
|
+
plugins: { format: await interopDefault(import("eslint-plugin-format")) }
|
|
385
381
|
}];
|
|
386
382
|
if (options.css) configs$1.push({
|
|
387
383
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
@@ -1978,7 +1974,7 @@ const defaultPluginRenaming = {
|
|
|
1978
1974
|
* The merged ESLint configurations.
|
|
1979
1975
|
*/
|
|
1980
1976
|
function eslintConfig(options = {}, ...userConfigs) {
|
|
1981
|
-
const { autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, pnpm: enableCatalogs = false, react: enableReact =
|
|
1977
|
+
const { autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, pnpm: enableCatalogs = false, react: enableReact = isPackageExists("react"), regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
1982
1978
|
let isInEditor = options.isInEditor;
|
|
1983
1979
|
if (isInEditor == null) {
|
|
1984
1980
|
isInEditor = isInEditorEnv();
|
|
@@ -2056,7 +2052,7 @@ function eslintConfig(options = {}, ...userConfigs) {
|
|
|
2056
2052
|
componentExts,
|
|
2057
2053
|
overrides: getOverrides(options, "markdown")
|
|
2058
2054
|
}));
|
|
2059
|
-
if (options.formatters) configs$1.push(formatters(options.formatters, typeof stylisticOptions === "boolean" ? {} : stylisticOptions));
|
|
2055
|
+
if (options.formatters || options.formatters === void 0) configs$1.push(formatters(options.formatters, typeof stylisticOptions === "boolean" ? {} : stylisticOptions));
|
|
2060
2056
|
configs$1.push(disables());
|
|
2061
2057
|
if ("files" in options) throw new Error("[@liwo/eslint-config] The first argument should not contain the \"files\" property as the options are supposed to be global. Place it in the second or later config instead.");
|
|
2062
2058
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liwo/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"description": "ESLint config by Liwo",
|
|
6
6
|
"author": "Aoang <aoang@x2oe.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,35 +25,18 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
29
28
|
"@prettier/plugin-xml": "^3.4.2",
|
|
30
29
|
"@unocss/eslint-plugin": "^66.3.3",
|
|
31
|
-
"eslint": "^9.31.0",
|
|
32
|
-
"eslint-plugin-format": "^1.0.1",
|
|
33
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
34
|
-
"eslint-plugin-react-refresh": "^0.4.20",
|
|
35
30
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
36
31
|
"prettier-plugin-slidev": "^1.0.5"
|
|
37
32
|
},
|
|
38
33
|
"peerDependenciesMeta": {
|
|
39
|
-
"@eslint-react/eslint-plugin": {
|
|
40
|
-
"optional": true
|
|
41
|
-
},
|
|
42
34
|
"@prettier/plugin-xml": {
|
|
43
35
|
"optional": true
|
|
44
36
|
},
|
|
45
37
|
"@unocss/eslint-plugin": {
|
|
46
38
|
"optional": true
|
|
47
39
|
},
|
|
48
|
-
"eslint-plugin-format": {
|
|
49
|
-
"optional": true
|
|
50
|
-
},
|
|
51
|
-
"eslint-plugin-react-hooks": {
|
|
52
|
-
"optional": true
|
|
53
|
-
},
|
|
54
|
-
"eslint-plugin-react-refresh": {
|
|
55
|
-
"optional": true
|
|
56
|
-
},
|
|
57
40
|
"eslint-plugin-vuejs-accessibility": {
|
|
58
41
|
"optional": true
|
|
59
42
|
},
|
|
@@ -62,65 +45,66 @@
|
|
|
62
45
|
}
|
|
63
46
|
},
|
|
64
47
|
"dependencies": {
|
|
65
|
-
"@antfu/install-pkg": "
|
|
66
|
-
"@clack/prompts": "
|
|
67
|
-
"@eslint-community/eslint-plugin-eslint-comments": "
|
|
68
|
-
"@eslint/
|
|
69
|
-
"@
|
|
70
|
-
"@
|
|
71
|
-
"@typescript-eslint/
|
|
72
|
-
"@
|
|
73
|
-
"eslint-
|
|
74
|
-
"eslint
|
|
75
|
-
"eslint-
|
|
76
|
-
"eslint-
|
|
77
|
-
"eslint-
|
|
78
|
-
"eslint-plugin-
|
|
79
|
-
"eslint-plugin-
|
|
80
|
-
"eslint-plugin-
|
|
81
|
-
"eslint-plugin-
|
|
82
|
-
"eslint-plugin-
|
|
83
|
-
"eslint-plugin-
|
|
84
|
-
"eslint-plugin-
|
|
85
|
-
"eslint-plugin-
|
|
86
|
-
"eslint-plugin-
|
|
87
|
-
"eslint-plugin-
|
|
88
|
-
"eslint-plugin-
|
|
89
|
-
"eslint-plugin-
|
|
90
|
-
"eslint-plugin-
|
|
91
|
-
"eslint-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
48
|
+
"@antfu/install-pkg": "1.1.0",
|
|
49
|
+
"@clack/prompts": "0.11.0",
|
|
50
|
+
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
51
|
+
"@eslint-react/eslint-plugin": "1.53.1",
|
|
52
|
+
"@eslint/markdown": "7.2.0",
|
|
53
|
+
"@stylistic/eslint-plugin": "5.3.1",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "8.42.0",
|
|
55
|
+
"@typescript-eslint/parser": "8.42.0",
|
|
56
|
+
"@vitest/eslint-plugin": "1.3.9",
|
|
57
|
+
"eslint": "9.35.0",
|
|
58
|
+
"eslint-config-flat-gitignore": "2.1.0",
|
|
59
|
+
"eslint-flat-config-utils": "2.1.1",
|
|
60
|
+
"eslint-merge-processors": "2.0.0",
|
|
61
|
+
"eslint-plugin-antfu": "3.1.1",
|
|
62
|
+
"eslint-plugin-command": "3.3.1",
|
|
63
|
+
"eslint-plugin-format": "1.0.1",
|
|
64
|
+
"eslint-plugin-import-lite": "0.3.0",
|
|
65
|
+
"eslint-plugin-jsdoc": "56.1.2",
|
|
66
|
+
"eslint-plugin-jsonc": "2.20.1",
|
|
67
|
+
"eslint-plugin-n": "17.23.0",
|
|
68
|
+
"eslint-plugin-no-only-tests": "3.3.0",
|
|
69
|
+
"eslint-plugin-perfectionist": "4.15.0",
|
|
70
|
+
"eslint-plugin-pnpm": "1.1.1",
|
|
71
|
+
"eslint-plugin-react-hooks": "5.2.0",
|
|
72
|
+
"eslint-plugin-react-refresh": "0.4.20",
|
|
73
|
+
"eslint-plugin-regexp": "2.10.0",
|
|
74
|
+
"eslint-plugin-toml": "0.12.0",
|
|
75
|
+
"eslint-plugin-unicorn": "61.0.2",
|
|
76
|
+
"eslint-plugin-unused-imports": "4.2.0",
|
|
77
|
+
"eslint-plugin-vue": "10.4.0",
|
|
78
|
+
"eslint-plugin-yml": "1.18.0",
|
|
79
|
+
"eslint-processor-vue-blocks": "2.0.0",
|
|
80
|
+
"globals": "16.4.0",
|
|
81
|
+
"jsonc-eslint-parser": "2.4.0",
|
|
82
|
+
"local-pkg": "1.1.2",
|
|
83
|
+
"parse-gitignore": "2.0.0",
|
|
84
|
+
"toml-eslint-parser": "0.10.0",
|
|
85
|
+
"vue-eslint-parser": "10.2.0",
|
|
86
|
+
"yaml-eslint-parser": "1.3.0"
|
|
99
87
|
},
|
|
100
88
|
"devDependencies": {
|
|
101
|
-
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
102
89
|
"@eslint/config-inspector": "^1.1.0",
|
|
103
90
|
"@prettier/plugin-xml": "^3.4.2",
|
|
104
|
-
"@types/node": "24.
|
|
91
|
+
"@types/node": "24.5.0",
|
|
105
92
|
"@unocss/eslint-plugin": "^66.3.3",
|
|
106
|
-
"eslint": "9.31.0",
|
|
107
|
-
"eslint-plugin-format": "1.0.1",
|
|
108
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
109
|
-
"eslint-plugin-react-refresh": "^0.4.20",
|
|
110
93
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
111
94
|
"eslint-typegen": "^2.2.1",
|
|
112
95
|
"execa": "^9.6.0",
|
|
113
96
|
"lint-staged": "^16.1.2",
|
|
114
97
|
"pnpm-workspace-yaml": "^1.0.0",
|
|
115
98
|
"prettier-plugin-slidev": "^1.0.5",
|
|
99
|
+
"react": "^19.1.0",
|
|
116
100
|
"simple-git-hooks": "^2.13.0",
|
|
117
101
|
"tinyglobby": "^0.2.14",
|
|
118
|
-
"tsdown": "^0.
|
|
102
|
+
"tsdown": "^0.14.2",
|
|
119
103
|
"tsx": "^4.20.3",
|
|
120
104
|
"typescript": "^5.8.3",
|
|
121
105
|
"vitest": "^3.2.4",
|
|
122
106
|
"vue": "^3.5.17",
|
|
123
|
-
"@liwo/eslint-config": "0.0.
|
|
107
|
+
"@liwo/eslint-config": "0.0.6"
|
|
124
108
|
},
|
|
125
109
|
"simple-git-hooks": {
|
|
126
110
|
"pre-commit": "npx lint-staged"
|
|
@@ -135,7 +119,7 @@
|
|
|
135
119
|
"build": "pnpm run gen && tsdown --clean --dts",
|
|
136
120
|
"stub": "tsdown",
|
|
137
121
|
"dev": "npx @eslint/config-inspector --config eslint.config.ts",
|
|
138
|
-
"build:inspector": "pnpm build && npx @eslint/config-inspector build",
|
|
122
|
+
"build:inspector": "pnpm build && npx @eslint/config-inspector build && tsx scripts/fixed-netlify.ts",
|
|
139
123
|
"watch": "tsdown --watch",
|
|
140
124
|
"lint": "eslint",
|
|
141
125
|
"gen": "tsx scripts/typegen.ts",
|