@cany748/eslint-config 4.1.0 → 4.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.d.ts → index.d.mts} +281 -152
- package/dist/{index.js → index.mjs} +20 -9
- package/package.json +23 -23
|
@@ -181,8 +181,7 @@ const parserPlain = {
|
|
|
181
181
|
* Combine array and non-array configs into a single array.
|
|
182
182
|
*/
|
|
183
183
|
async function combine(...configs$1) {
|
|
184
|
-
|
|
185
|
-
return resolved.flat();
|
|
184
|
+
return (await Promise.all(configs$1)).flat();
|
|
186
185
|
}
|
|
187
186
|
function toArray(value) {
|
|
188
187
|
return Array.isArray(value) ? value : [value];
|
|
@@ -254,7 +253,12 @@ function formatters(options = true) {
|
|
|
254
253
|
//#endregion
|
|
255
254
|
//#region src/configs/ignores.ts
|
|
256
255
|
function ignores(userIgnores = []) {
|
|
257
|
-
|
|
256
|
+
let ignores$1 = [...GLOB_EXCLUDE];
|
|
257
|
+
ignores$1 = typeof userIgnores === "function" ? userIgnores(ignores$1) : [...ignores$1, ...userIgnores];
|
|
258
|
+
return [{
|
|
259
|
+
ignores: ignores$1,
|
|
260
|
+
name: "ignores"
|
|
261
|
+
}];
|
|
258
262
|
}
|
|
259
263
|
|
|
260
264
|
//#endregion
|
|
@@ -286,7 +290,7 @@ function javascript(options = {}) {
|
|
|
286
290
|
const { isInEditor = false, overrides = {} } = options;
|
|
287
291
|
return [{
|
|
288
292
|
languageOptions: {
|
|
289
|
-
ecmaVersion:
|
|
293
|
+
ecmaVersion: "latest",
|
|
290
294
|
globals: {
|
|
291
295
|
...globals.browser,
|
|
292
296
|
...globals.es2021,
|
|
@@ -297,7 +301,7 @@ function javascript(options = {}) {
|
|
|
297
301
|
},
|
|
298
302
|
parserOptions: {
|
|
299
303
|
ecmaFeatures: { jsx: true },
|
|
300
|
-
ecmaVersion:
|
|
304
|
+
ecmaVersion: "latest",
|
|
301
305
|
sourceType: "module"
|
|
302
306
|
},
|
|
303
307
|
sourceType: "module"
|
|
@@ -667,6 +671,14 @@ function sortPackageJson() {
|
|
|
667
671
|
order: { type: "asc" },
|
|
668
672
|
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
669
673
|
},
|
|
674
|
+
{
|
|
675
|
+
order: { type: "asc" },
|
|
676
|
+
pathPattern: String.raw`^workspaces\.catalog$`
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
order: { type: "asc" },
|
|
680
|
+
pathPattern: String.raw`^workspaces\.catalogs\.[^.]+$`
|
|
681
|
+
},
|
|
670
682
|
{
|
|
671
683
|
order: [
|
|
672
684
|
"types",
|
|
@@ -986,9 +998,8 @@ function unicorn() {
|
|
|
986
998
|
//#endregion
|
|
987
999
|
//#region src/configs/unocss.ts
|
|
988
1000
|
async function unocss() {
|
|
989
|
-
const pluginUnoCSS = await interopDefault(import("@unocss/eslint-plugin"));
|
|
990
1001
|
return [{
|
|
991
|
-
...
|
|
1002
|
+
...(await interopDefault(import("@unocss/eslint-plugin"))).configs.flat,
|
|
992
1003
|
name: "unocss"
|
|
993
1004
|
}];
|
|
994
1005
|
}
|
|
@@ -1117,7 +1128,7 @@ const VuePackages = [
|
|
|
1117
1128
|
* The merged ESLint configurations.
|
|
1118
1129
|
*/
|
|
1119
1130
|
const factoryConfig = function(options = {}, ...userConfigs) {
|
|
1120
|
-
const { componentExts = [], formatters: enableFormatters = true, gitignore: enableGitignore = true, jsonc: enableJSONC = true, regexp: enableRegexp = true, test: enableTest = true, typescript: enableTypeScript = isPackageExists("typescript"), unocss: enableUnoCSS = isPackageExists("unocss"), vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
1131
|
+
const { componentExts = [], formatters: enableFormatters = true, gitignore: enableGitignore = true, ignores: userIgnores = [], jsonc: enableJSONC = true, regexp: enableRegexp = true, test: enableTest = true, typescript: enableTypeScript = isPackageExists("typescript"), unocss: enableUnoCSS = isPackageExists("unocss"), vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
1121
1132
|
let isInEditor = options.isInEditor;
|
|
1122
1133
|
if (isInEditor == null) {
|
|
1123
1134
|
isInEditor = isInEditorEnv();
|
|
@@ -1126,7 +1137,7 @@ const factoryConfig = function(options = {}, ...userConfigs) {
|
|
|
1126
1137
|
const configs$1 = [];
|
|
1127
1138
|
if (enableGitignore) if (typeof enableGitignore === "boolean") configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({ strict: false })]));
|
|
1128
1139
|
else configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)]));
|
|
1129
|
-
configs$1.push(comments(), ignores(
|
|
1140
|
+
configs$1.push(comments(), ignores(userIgnores), imports(), javascript({
|
|
1130
1141
|
isInEditor,
|
|
1131
1142
|
overrides: options.javascript?.overrides
|
|
1132
1143
|
}), node(), unicorn());
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cany748/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.2.0",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js"
|
|
7
7
|
},
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@unocss/eslint-plugin": "^66.
|
|
15
|
-
"eslint-plugin-vue": "^10.
|
|
16
|
-
"typescript-eslint": "^8.
|
|
14
|
+
"@unocss/eslint-plugin": "^66.5.10",
|
|
15
|
+
"eslint-plugin-vue": "^10.6.2",
|
|
16
|
+
"typescript-eslint": "^8.49.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependenciesMeta": {
|
|
19
19
|
"@unocss/eslint-plugin": {
|
|
@@ -28,36 +28,36 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
31
|
-
"@vitest/eslint-plugin": "^1.
|
|
32
|
-
"eslint": "^9.
|
|
31
|
+
"@vitest/eslint-plugin": "^1.5.2",
|
|
32
|
+
"eslint": "^9.39.2",
|
|
33
33
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
34
34
|
"eslint-config-prettier": "^10.1.8",
|
|
35
|
-
"eslint-flat-config-utils": "^2.1.
|
|
35
|
+
"eslint-flat-config-utils": "^2.1.4",
|
|
36
36
|
"eslint-plugin-import-x": "^4.16.1",
|
|
37
|
-
"eslint-plugin-jsonc": "^2.
|
|
38
|
-
"eslint-plugin-n": "^17.
|
|
37
|
+
"eslint-plugin-jsonc": "^2.21.0",
|
|
38
|
+
"eslint-plugin-n": "^17.23.1",
|
|
39
39
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
40
40
|
"eslint-plugin-prettier": "^5.5.4",
|
|
41
41
|
"eslint-plugin-regexp": "^2.10.0",
|
|
42
|
-
"eslint-plugin-unicorn": "^
|
|
43
|
-
"eslint-plugin-unused-imports": "^4.
|
|
44
|
-
"globals": "^16.
|
|
45
|
-
"jiti": "^2.
|
|
46
|
-
"jsonc-eslint-parser": "^2.4.
|
|
42
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
43
|
+
"eslint-plugin-unused-imports": "^4.3.0",
|
|
44
|
+
"globals": "^16.5.0",
|
|
45
|
+
"jiti": "^2.6.1",
|
|
46
|
+
"jsonc-eslint-parser": "^2.4.2",
|
|
47
47
|
"local-pkg": "^1.1.2",
|
|
48
|
-
"prettier": "^3.
|
|
48
|
+
"prettier": "^3.7.4"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@types/node": "^
|
|
52
|
-
"@unocss/eslint-plugin": "^66.
|
|
53
|
-
"bumpp": "^10.2
|
|
54
|
-
"eslint-plugin-vue": "^10.
|
|
51
|
+
"@types/node": "^25.0.2",
|
|
52
|
+
"@unocss/eslint-plugin": "^66.5.10",
|
|
53
|
+
"bumpp": "^10.3.2",
|
|
54
|
+
"eslint-plugin-vue": "^10.6.2",
|
|
55
55
|
"eslint-typegen": "^2.3.0",
|
|
56
|
-
"lint-staged": "^16.
|
|
56
|
+
"lint-staged": "^16.2.7",
|
|
57
57
|
"simple-git-hooks": "^2.13.1",
|
|
58
|
-
"tsdown": "^0.
|
|
59
|
-
"typescript": "^5.9.
|
|
60
|
-
"typescript-eslint": "^8.
|
|
58
|
+
"tsdown": "^0.17.4",
|
|
59
|
+
"typescript": "^5.9.3",
|
|
60
|
+
"typescript-eslint": "^8.49.0"
|
|
61
61
|
},
|
|
62
62
|
"simple-git-hooks": {
|
|
63
63
|
"pre-commit": "pnpm lint-staged"
|