@wongxy/eslint-config 3.0.1 → 4.0.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.cjs +29 -26
- package/dist/index.d.cts +2696 -296
- package/dist/index.d.mts +3079 -0
- package/dist/{index.js → index.mjs} +16 -10
- package/package.json +28 -26
- package/dist/index.d.ts +0 -679
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -15,19 +15,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
}
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
19
|
value: mod,
|
|
20
20
|
enumerable: true
|
|
21
21
|
}) : target, mod));
|
|
22
|
-
|
|
23
22
|
//#endregion
|
|
24
|
-
let
|
|
25
|
-
__antfu_eslint_config = __toESM(__antfu_eslint_config);
|
|
23
|
+
let _antfu_eslint_config = require("@antfu/eslint-config");
|
|
26
24
|
let local_pkg = require("local-pkg");
|
|
27
|
-
local_pkg = __toESM(local_pkg);
|
|
28
25
|
let eslint_plugin_better_tailwindcss = require("eslint-plugin-better-tailwindcss");
|
|
29
|
-
eslint_plugin_better_tailwindcss = __toESM(eslint_plugin_better_tailwindcss);
|
|
30
|
-
|
|
26
|
+
eslint_plugin_better_tailwindcss = __toESM(eslint_plugin_better_tailwindcss, 1);
|
|
31
27
|
//#region src/tailwindcss.ts
|
|
32
28
|
async function tailwindcss(options = {}) {
|
|
33
29
|
const { overrides = {}, settings } = options;
|
|
@@ -37,7 +33,7 @@ async function tailwindcss(options = {}) {
|
|
|
37
33
|
"tw/no-duplicate-classes": "warn",
|
|
38
34
|
"tw/no-unnecessary-whitespace": "warn",
|
|
39
35
|
"tw/no-conflicting-classes": "warn",
|
|
40
|
-
"tw/no-
|
|
36
|
+
"tw/no-unknown-classes": "warn"
|
|
41
37
|
};
|
|
42
38
|
return [{
|
|
43
39
|
name: "wongxy/tailwindcss/setup",
|
|
@@ -52,7 +48,6 @@ async function tailwindcss(options = {}) {
|
|
|
52
48
|
}
|
|
53
49
|
}];
|
|
54
50
|
}
|
|
55
|
-
|
|
56
51
|
//#endregion
|
|
57
52
|
//#region src/index.ts
|
|
58
53
|
const VuePackages = [
|
|
@@ -95,18 +90,27 @@ function wongxy(options = {}, ...userConfigs) {
|
|
|
95
90
|
"unknown",
|
|
96
91
|
"reserved-last"
|
|
97
92
|
],
|
|
98
|
-
customGroups:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
customGroups: [
|
|
94
|
+
{
|
|
95
|
+
groupName: "reserved-first",
|
|
96
|
+
elementNamePattern: ["key", "ref"]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
groupName: "reserved-second",
|
|
100
|
+
elementNamePattern: ["id", "name"]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
groupName: "reserved-last",
|
|
104
|
+
elementNamePattern: ["asChild"]
|
|
105
|
+
}
|
|
106
|
+
]
|
|
103
107
|
}]
|
|
104
108
|
})
|
|
105
109
|
});
|
|
106
110
|
if (enableVue) configs.push({
|
|
107
111
|
name: "wongxy/vue",
|
|
108
|
-
files: [
|
|
109
|
-
rules: resolveRules((0,
|
|
112
|
+
files: [_antfu_eslint_config.GLOB_VUE],
|
|
113
|
+
rules: resolveRules((0, _antfu_eslint_config.getOverrides)(options, "vue"), {
|
|
110
114
|
"vue/singleline-html-element-content-newline": "off",
|
|
111
115
|
"vue/valid-template-root": "off",
|
|
112
116
|
"vue/block-order": ["warn", { order: [["script", "template"], "style"] }],
|
|
@@ -115,13 +119,13 @@ function wongxy(options = {}, ...userConfigs) {
|
|
|
115
119
|
});
|
|
116
120
|
if (enableReact) configs.push({
|
|
117
121
|
name: "wongxy/react",
|
|
118
|
-
files: [
|
|
119
|
-
rules: resolveRules((0,
|
|
122
|
+
files: [_antfu_eslint_config.GLOB_SRC],
|
|
123
|
+
rules: resolveRules((0, _antfu_eslint_config.getOverrides)(options, "react"), { "react/prefer-destructuring-assignment": "off" })
|
|
120
124
|
});
|
|
121
125
|
if (enableTypeScript) configs.push({
|
|
122
126
|
name: "wongxy/typescript",
|
|
123
|
-
files: [
|
|
124
|
-
rules: resolveRules((0,
|
|
127
|
+
files: [_antfu_eslint_config.GLOB_TS, _antfu_eslint_config.GLOB_TSX],
|
|
128
|
+
rules: resolveRules((0, _antfu_eslint_config.getOverrides)(options, "typescript"), { "ts/consistent-type-imports": ["error", {
|
|
125
129
|
disallowTypeAnnotations: false,
|
|
126
130
|
fixStyle: "inline-type-imports",
|
|
127
131
|
prefer: "type-imports"
|
|
@@ -129,8 +133,8 @@ function wongxy(options = {}, ...userConfigs) {
|
|
|
129
133
|
});
|
|
130
134
|
if (enableReactNative) configs.push({
|
|
131
135
|
name: "wongxy/reactnative",
|
|
132
|
-
files: [
|
|
133
|
-
rules: resolveRules((0,
|
|
136
|
+
files: [_antfu_eslint_config.GLOB_TS, _antfu_eslint_config.GLOB_TSX],
|
|
137
|
+
rules: resolveRules((0, _antfu_eslint_config.getOverrides)(options, "typescript"), {
|
|
134
138
|
"ts/no-require-imports": "off",
|
|
135
139
|
"ts/no-use-before-define": "off"
|
|
136
140
|
})
|
|
@@ -139,8 +143,7 @@ function wongxy(options = {}, ...userConfigs) {
|
|
|
139
143
|
const tw = typeof options.tailwindcss === "object" ? options.tailwindcss : void 0;
|
|
140
144
|
configs.push(tailwindcss(tw));
|
|
141
145
|
}
|
|
142
|
-
return (0,
|
|
146
|
+
return (0, _antfu_eslint_config.antfu)(options, ...configs, ...userConfigs);
|
|
143
147
|
}
|
|
144
|
-
|
|
145
148
|
//#endregion
|
|
146
|
-
module.exports = wongxy;
|
|
149
|
+
module.exports = wongxy;
|