@coderwyd/eslint-config 5.0.1 → 5.1.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.mjs +13 -17
- package/package.json +13 -14
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import antfu, { GLOB_SRC, interopDefault, resolveSubOptions } from "@antfu/eslint-config";
|
|
3
|
-
import { createDefu } from "defu";
|
|
2
|
+
import antfu, { GLOB_SRC, GLOB_VUE, interopDefault, resolveSubOptions } from "@antfu/eslint-config";
|
|
4
3
|
import process from "node:process";
|
|
5
4
|
//#region \0rolldown/runtime.js
|
|
6
5
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
7
6
|
//#endregion
|
|
8
7
|
//#region src/config/tailwindcss.ts
|
|
9
8
|
async function tailwindcss(options = {}) {
|
|
10
|
-
const { files = [GLOB_SRC], overrides = {}, settings = {} } = options;
|
|
9
|
+
const { files = [GLOB_SRC, GLOB_VUE], overrides = {}, settings = {} } = options;
|
|
11
10
|
return [{
|
|
12
11
|
name: "coderwyd/tailwindcss/setup",
|
|
13
12
|
plugins: { tailwindcss: await interopDefault(import("eslint-plugin-better-tailwindcss")) }
|
|
@@ -40,12 +39,17 @@ function isPackageExists(name) {
|
|
|
40
39
|
}
|
|
41
40
|
//#endregion
|
|
42
41
|
//#region src/merge-options.ts
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
function deepMerge(user, defaults) {
|
|
43
|
+
const result = { ...user };
|
|
44
|
+
for (const key of Object.keys(defaults)) {
|
|
45
|
+
const userVal = result[key];
|
|
46
|
+
const defaultVal = defaults[key];
|
|
47
|
+
if (userVal === void 0) result[key] = defaultVal;
|
|
48
|
+
else if (userVal === true && typeof defaultVal === "object") result[key] = defaultVal;
|
|
49
|
+
else if (typeof userVal === "object" && userVal !== null && typeof defaultVal === "object" && defaultVal !== null) result[key] = deepMerge(userVal, defaultVal);
|
|
47
50
|
}
|
|
48
|
-
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
49
53
|
function mergeOptions(options) {
|
|
50
54
|
const { vueVersion = 3 } = resolveSubOptions(options ?? {}, "vue");
|
|
51
55
|
const defaults = {
|
|
@@ -89,15 +93,7 @@ function mergeOptions(options) {
|
|
|
89
93
|
isInEditor: false
|
|
90
94
|
};
|
|
91
95
|
if (!options) return defaults;
|
|
92
|
-
|
|
93
|
-
for (const key of Object.keys(defaults)) {
|
|
94
|
-
const userValue = options[key];
|
|
95
|
-
const defaultValue = defaults[key];
|
|
96
|
-
if (userValue === void 0) result[key] = defaultValue;
|
|
97
|
-
else if (typeof defaultValue === "boolean") {} else if (userValue === true) result[key] = defaultValue;
|
|
98
|
-
else if (typeof userValue === "object" && userValue !== null && defaultValue) result[key] = defuOverrideArray(userValue, defaultValue);
|
|
99
|
-
}
|
|
100
|
-
return result;
|
|
96
|
+
return deepMerge(options, defaults);
|
|
101
97
|
}
|
|
102
98
|
//#endregion
|
|
103
99
|
//#region src/index.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderwyd/eslint-config",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Donny's ESLint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -29,24 +29,23 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@antfu/eslint-config": "^
|
|
33
|
-
"
|
|
34
|
-
"eslint-flat-config-utils": "^3.1.0"
|
|
32
|
+
"@antfu/eslint-config": "^9.0.0",
|
|
33
|
+
"eslint-flat-config-utils": "^3.2.0"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@eslint/config-inspector": "^
|
|
38
|
-
"@types/node": "^25.
|
|
36
|
+
"@eslint/config-inspector": "^3.0.3",
|
|
37
|
+
"@types/node": "^25.9.1",
|
|
39
38
|
"@typescript/native-preview": "7.0.0-dev.20260107.1",
|
|
40
|
-
"bumpp": "^11.0
|
|
41
|
-
"eslint": "^10.
|
|
42
|
-
"eslint-plugin-better-tailwindcss": "^4.
|
|
39
|
+
"bumpp": "^11.1.0",
|
|
40
|
+
"eslint": "^10.4.0",
|
|
41
|
+
"eslint-plugin-better-tailwindcss": "^4.5.0",
|
|
43
42
|
"eslint-typegen": "^2.3.1",
|
|
44
43
|
"nano-staged": "^1.0.2",
|
|
45
|
-
"oxfmt": "^0.
|
|
46
|
-
"publint": "^0.3.
|
|
44
|
+
"oxfmt": "^0.52.0",
|
|
45
|
+
"publint": "^0.3.21",
|
|
47
46
|
"simple-git-hooks": "^2.13.1",
|
|
48
|
-
"tsdown": "^0.
|
|
49
|
-
"typescript": "^6.0.
|
|
47
|
+
"tsdown": "^0.22.0",
|
|
48
|
+
"typescript": "^6.0.3",
|
|
50
49
|
"unplugin-unused": "^0.5.7"
|
|
51
50
|
},
|
|
52
51
|
"peerDependencies": {
|
|
@@ -68,7 +67,7 @@
|
|
|
68
67
|
]
|
|
69
68
|
},
|
|
70
69
|
"engines": {
|
|
71
|
-
"node": ">=
|
|
70
|
+
"node": "^22.18.0 || >=24.0.0"
|
|
72
71
|
},
|
|
73
72
|
"scripts": {
|
|
74
73
|
"build": "pnpm build:typegen && tsdown",
|