@vida0905/eslint-config 0.1.2 → 0.1.3
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 +14 -28
- package/dist/index.js +12 -26
- package/package.json +8 -9
package/dist/index.cjs
CHANGED
|
@@ -34,7 +34,7 @@ __export(src_exports, {
|
|
|
34
34
|
vida: () => vida
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(src_exports);
|
|
37
|
-
var
|
|
37
|
+
var import_eslint_config2 = __toESM(require("@antfu/eslint-config"), 1);
|
|
38
38
|
var import_local_pkg = require("local-pkg");
|
|
39
39
|
|
|
40
40
|
// src/configs/pinia.ts
|
|
@@ -42,7 +42,7 @@ var import_eslint_config = require("@antfu/eslint-config");
|
|
|
42
42
|
var import_eslint_plugin_pinia = __toESM(require("eslint-plugin-pinia"), 1);
|
|
43
43
|
var pinia = [
|
|
44
44
|
{
|
|
45
|
-
name: "vida
|
|
45
|
+
name: "vida/pinia",
|
|
46
46
|
files: [import_eslint_config.GLOB_JS, import_eslint_config.GLOB_TS],
|
|
47
47
|
plugins: {
|
|
48
48
|
pinia: import_eslint_plugin_pinia.default
|
|
@@ -58,37 +58,20 @@ var pinia = [
|
|
|
58
58
|
}
|
|
59
59
|
];
|
|
60
60
|
|
|
61
|
-
// src/
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"vue/max-attributes-per-line": ["error", {
|
|
69
|
-
singleline: { max: 5 },
|
|
70
|
-
multiline: { max: 1 }
|
|
71
|
-
}]
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
];
|
|
61
|
+
// src/overrides/vue.ts
|
|
62
|
+
var vue = {
|
|
63
|
+
"vue/max-attributes-per-line": ["error", {
|
|
64
|
+
singleline: 5,
|
|
65
|
+
multiline: 1
|
|
66
|
+
}]
|
|
67
|
+
};
|
|
75
68
|
|
|
76
69
|
// src/index.ts
|
|
77
|
-
var VuePackages = [
|
|
78
|
-
"vue",
|
|
79
|
-
"nuxt",
|
|
80
|
-
"vitepress",
|
|
81
|
-
"@slidev/cli"
|
|
82
|
-
];
|
|
83
70
|
function vida(options = {}, ...userConfigs) {
|
|
84
71
|
const {
|
|
85
|
-
pinia: enablePinia = (0, import_local_pkg.isPackageExists)("pinia")
|
|
86
|
-
// https://github.com/antfu/eslint-config/blob/main/src/factory.ts
|
|
87
|
-
vue: enableVue = VuePackages.some((i) => (0, import_local_pkg.isPackageExists)(i))
|
|
72
|
+
pinia: enablePinia = (0, import_local_pkg.isPackageExists)("pinia")
|
|
88
73
|
} = options;
|
|
89
74
|
const configs = [];
|
|
90
|
-
if (enableVue)
|
|
91
|
-
configs.push(vue);
|
|
92
75
|
if (enablePinia)
|
|
93
76
|
configs.push(pinia);
|
|
94
77
|
const antfuConfig = {
|
|
@@ -101,9 +84,12 @@ function vida(options = {}, ...userConfigs) {
|
|
|
101
84
|
css: true,
|
|
102
85
|
html: true
|
|
103
86
|
},
|
|
87
|
+
vue: {
|
|
88
|
+
overrides: vue
|
|
89
|
+
},
|
|
104
90
|
jsx: false
|
|
105
91
|
};
|
|
106
|
-
return (0,
|
|
92
|
+
return (0, import_eslint_config2.default)(
|
|
107
93
|
{
|
|
108
94
|
...antfuConfig,
|
|
109
95
|
...options
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { GLOB_JS, GLOB_TS } from "@antfu/eslint-config";
|
|
|
7
7
|
import pluginPinia from "eslint-plugin-pinia";
|
|
8
8
|
var pinia = [
|
|
9
9
|
{
|
|
10
|
-
name: "vida
|
|
10
|
+
name: "vida/pinia",
|
|
11
11
|
files: [GLOB_JS, GLOB_TS],
|
|
12
12
|
plugins: {
|
|
13
13
|
pinia: pluginPinia
|
|
@@ -23,37 +23,20 @@ var pinia = [
|
|
|
23
23
|
}
|
|
24
24
|
];
|
|
25
25
|
|
|
26
|
-
// src/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"vue/max-attributes-per-line": ["error", {
|
|
34
|
-
singleline: { max: 5 },
|
|
35
|
-
multiline: { max: 1 }
|
|
36
|
-
}]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
];
|
|
26
|
+
// src/overrides/vue.ts
|
|
27
|
+
var vue = {
|
|
28
|
+
"vue/max-attributes-per-line": ["error", {
|
|
29
|
+
singleline: 5,
|
|
30
|
+
multiline: 1
|
|
31
|
+
}]
|
|
32
|
+
};
|
|
40
33
|
|
|
41
34
|
// src/index.ts
|
|
42
|
-
var VuePackages = [
|
|
43
|
-
"vue",
|
|
44
|
-
"nuxt",
|
|
45
|
-
"vitepress",
|
|
46
|
-
"@slidev/cli"
|
|
47
|
-
];
|
|
48
35
|
function vida(options = {}, ...userConfigs) {
|
|
49
36
|
const {
|
|
50
|
-
pinia: enablePinia = isPackageExists("pinia")
|
|
51
|
-
// https://github.com/antfu/eslint-config/blob/main/src/factory.ts
|
|
52
|
-
vue: enableVue = VuePackages.some((i) => isPackageExists(i))
|
|
37
|
+
pinia: enablePinia = isPackageExists("pinia")
|
|
53
38
|
} = options;
|
|
54
39
|
const configs = [];
|
|
55
|
-
if (enableVue)
|
|
56
|
-
configs.push(vue);
|
|
57
40
|
if (enablePinia)
|
|
58
41
|
configs.push(pinia);
|
|
59
42
|
const antfuConfig = {
|
|
@@ -66,6 +49,9 @@ function vida(options = {}, ...userConfigs) {
|
|
|
66
49
|
css: true,
|
|
67
50
|
html: true
|
|
68
51
|
},
|
|
52
|
+
vue: {
|
|
53
|
+
overrides: vue
|
|
54
|
+
},
|
|
69
55
|
jsx: false
|
|
70
56
|
};
|
|
71
57
|
return antfu(
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vida0905/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"packageManager": "pnpm@8.15.6",
|
|
6
6
|
"description": "Vida Xie's ESLint Config",
|
|
7
7
|
"author": "Vida Xie <vida_2020@163.com> (https://github.com/9romise/)",
|
|
@@ -35,24 +35,23 @@
|
|
|
35
35
|
"build": "tsup",
|
|
36
36
|
"release": "bumpp && pnpm publish",
|
|
37
37
|
"typecheck": "tsc --noEmit",
|
|
38
|
-
"
|
|
38
|
+
"prepare": "npm run build"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"eslint": ">=8.
|
|
41
|
+
"eslint": ">=8.40.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@antfu/eslint-config": "^2.
|
|
45
|
-
"eslint-plugin-pinia": "^0.1.
|
|
44
|
+
"@antfu/eslint-config": "^2.13.3",
|
|
45
|
+
"eslint-plugin-pinia": "^0.1.12",
|
|
46
46
|
"local-pkg": "^0.5.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@eslint/config-inspector": "^0.3.1",
|
|
50
50
|
"@unocss/eslint-plugin": "0.59.0-beta.1",
|
|
51
51
|
"bumpp": "^9.4.0",
|
|
52
|
-
"eslint": "
|
|
52
|
+
"eslint": "^9.0.0",
|
|
53
53
|
"eslint-plugin-format": "^0.1.0",
|
|
54
|
-
"eslint-ts-patch": "8.57.0-0",
|
|
55
54
|
"tsup": "^8.0.2",
|
|
56
|
-
"typescript": "^5.4.
|
|
55
|
+
"typescript": "^5.4.5"
|
|
57
56
|
}
|
|
58
|
-
}
|
|
57
|
+
}
|