@unocss/eslint-plugin 66.5.10-beta.1 → 66.5.11
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/dirs-DMLliOn8.cjs +13 -0
- package/dist/dirs-DTjbV7PE.mjs +7 -0
- package/dist/dirs.cjs +2 -7
- package/dist/dirs.d.cts +3 -2
- package/dist/dirs.d.mts +3 -2
- package/dist/dirs.mjs +2 -4
- package/dist/index.cjs +461 -554
- package/dist/index.d.cts +64 -37
- package/dist/index.d.mts +64 -37
- package/dist/index.mjs +430 -548
- package/dist/worker.d.mts +957 -0
- package/dist/worker.mjs +87 -105
- package/package.json +18 -12
- package/dist/dirs.d.ts +0 -3
- package/dist/index.d.ts +0 -45
package/dist/index.cjs
CHANGED
|
@@ -1,575 +1,482 @@
|
|
|
1
|
-
'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
//#region rolldown:runtime
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
12
27
|
|
|
13
|
-
|
|
28
|
+
//#endregion
|
|
29
|
+
const require_dirs = require('./dirs-DMLliOn8.cjs');
|
|
30
|
+
let node_path = require("node:path");
|
|
31
|
+
let _typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
32
|
+
let synckit = require("synckit");
|
|
33
|
+
let magic_string = require("magic-string");
|
|
34
|
+
magic_string = __toESM(magic_string);
|
|
35
|
+
let _typescript_eslint_types = require("@typescript-eslint/types");
|
|
14
36
|
|
|
37
|
+
//#region src/constants.ts
|
|
15
38
|
const CLASS_FIELDS = ["class", "classname"];
|
|
16
39
|
const AST_NODES_WITH_QUOTES = ["Literal", "VLiteral"];
|
|
17
40
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
);
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/rules/_.ts
|
|
43
|
+
const syncAction = (0, synckit.createSyncFn)((0, node_path.join)(require_dirs.distDir, "worker.mjs"));
|
|
44
|
+
const createRule = _typescript_eslint_utils.ESLintUtils.RuleCreator(() => "https://unocss.dev/integrations/eslint#rules");
|
|
22
45
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
const parserServices = context?.sourceCode.parserServices || context.parserServices;
|
|
72
|
-
if (parserServices == null || parserServices.defineTemplateBodyVisitor == null) {
|
|
73
|
-
return scriptVisitor;
|
|
74
|
-
} else {
|
|
75
|
-
return parserServices?.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/rules/order-attributify.ts
|
|
48
|
+
const IGNORE_ATTRIBUTES = [
|
|
49
|
+
"style",
|
|
50
|
+
"class",
|
|
51
|
+
"classname",
|
|
52
|
+
"value"
|
|
53
|
+
];
|
|
54
|
+
var order_attributify_default = createRule({
|
|
55
|
+
name: "order-attributify",
|
|
56
|
+
meta: {
|
|
57
|
+
type: "layout",
|
|
58
|
+
fixable: "code",
|
|
59
|
+
docs: { description: "Order of UnoCSS attributes" },
|
|
60
|
+
messages: { "invalid-order": "UnoCSS attributes are not ordered" },
|
|
61
|
+
schema: []
|
|
62
|
+
},
|
|
63
|
+
defaultOptions: [],
|
|
64
|
+
create(context) {
|
|
65
|
+
const scriptVisitor = {};
|
|
66
|
+
const templateBodyVisitor = { VStartTag(node) {
|
|
67
|
+
var _context$settings$uno;
|
|
68
|
+
const valueless = node.attributes.filter((i) => {
|
|
69
|
+
var _i$key, _i$key2;
|
|
70
|
+
return typeof ((_i$key = i.key) === null || _i$key === void 0 ? void 0 : _i$key.name) === "string" && !IGNORE_ATTRIBUTES.includes((_i$key2 = i.key) === null || _i$key2 === void 0 || (_i$key2 = _i$key2.name) === null || _i$key2 === void 0 ? void 0 : _i$key2.toLowerCase()) && i.value == null;
|
|
71
|
+
});
|
|
72
|
+
if (!valueless.length) return;
|
|
73
|
+
const input = valueless.map((i) => i.key.name).join(" ").trim();
|
|
74
|
+
const sorted = syncAction((_context$settings$uno = context.settings.unocss) === null || _context$settings$uno === void 0 ? void 0 : _context$settings$uno.configPath, "sort", input, context.filename);
|
|
75
|
+
if (sorted !== input) context.report({
|
|
76
|
+
node,
|
|
77
|
+
messageId: "invalid-order",
|
|
78
|
+
fix(fixer) {
|
|
79
|
+
const codeFull = context.getSourceCode();
|
|
80
|
+
const offset = node.range[0];
|
|
81
|
+
const s = new magic_string.default(codeFull.getText().slice(node.range[0], node.range[1]));
|
|
82
|
+
const sortedNodes = valueless.map((i) => [i.range[0] - offset, i.range[1] - offset]).sort((a, b) => b[0] - a[0]);
|
|
83
|
+
for (const [start, end] of sortedNodes.slice(1)) s.remove(start, end);
|
|
84
|
+
s.overwrite(sortedNodes[0][0], sortedNodes[0][1], ` ${sorted.trim()} `);
|
|
85
|
+
return fixer.replaceText(node, s.toString());
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
} };
|
|
89
|
+
const parserServices = (context === null || context === void 0 ? void 0 : context.sourceCode.parserServices) || context.parserServices;
|
|
90
|
+
if (parserServices == null || parserServices.defineTemplateBodyVisitor == null) return scriptVisitor;
|
|
91
|
+
else return parserServices === null || parserServices === void 0 ? void 0 : parserServices.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor);
|
|
92
|
+
}
|
|
78
93
|
});
|
|
79
94
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
node: node2,
|
|
154
|
-
messageId: "in-blocklist",
|
|
155
|
-
data: {
|
|
156
|
-
name,
|
|
157
|
-
reason: meta?.message ? `: ${meta.message}` : ""
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
const parserServices = context?.sourceCode.parserServices || context.parserServices;
|
|
165
|
-
if (parserServices == null || parserServices.defineTemplateBodyVisitor == null) {
|
|
166
|
-
return scriptVisitor;
|
|
167
|
-
} else {
|
|
168
|
-
return parserServices?.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/rules/blocklist.ts
|
|
97
|
+
var blocklist_default = createRule({
|
|
98
|
+
name: "blocklist",
|
|
99
|
+
meta: {
|
|
100
|
+
type: "problem",
|
|
101
|
+
fixable: "code",
|
|
102
|
+
docs: { description: "Utilities in UnoCSS blocklist" },
|
|
103
|
+
messages: { "in-blocklist": "\"{{name}}\" is in blocklist{{reason}}" },
|
|
104
|
+
schema: []
|
|
105
|
+
},
|
|
106
|
+
defaultOptions: [],
|
|
107
|
+
create(context) {
|
|
108
|
+
const checkLiteral = (node) => {
|
|
109
|
+
var _context$settings$uno;
|
|
110
|
+
if (typeof node.value !== "string" || !node.value.trim()) return;
|
|
111
|
+
const input = node.value;
|
|
112
|
+
syncAction((_context$settings$uno = context.settings.unocss) === null || _context$settings$uno === void 0 ? void 0 : _context$settings$uno.configPath, "blocklist", input, context.filename).forEach(([name, meta]) => {
|
|
113
|
+
context.report({
|
|
114
|
+
node,
|
|
115
|
+
messageId: "in-blocklist",
|
|
116
|
+
data: {
|
|
117
|
+
name,
|
|
118
|
+
reason: (meta === null || meta === void 0 ? void 0 : meta.message) ? `: ${meta.message}` : ""
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
const scriptVisitor = {
|
|
124
|
+
JSXAttribute(node) {
|
|
125
|
+
if (typeof node.name.name === "string" && CLASS_FIELDS.includes(node.name.name.toLowerCase()) && node.value) {
|
|
126
|
+
if (node.value.type === "Literal") checkLiteral(node.value);
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
SvelteAttribute(node) {
|
|
130
|
+
if (node.key.name === "class") {
|
|
131
|
+
var _node$value;
|
|
132
|
+
if (((_node$value = node.value) === null || _node$value === void 0 ? void 0 : _node$value[0].type) === "SvelteLiteral") checkLiteral(node.value[0]);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const templateBodyVisitor = {
|
|
137
|
+
VAttribute(node) {
|
|
138
|
+
if (node.key.name === "class") {
|
|
139
|
+
if (node.value.type === "VLiteral") checkLiteral(node.value);
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
VStartTag(node) {
|
|
143
|
+
const valueless = node.attributes.filter((i) => {
|
|
144
|
+
var _i$key, _i$key2;
|
|
145
|
+
return typeof ((_i$key = i.key) === null || _i$key === void 0 ? void 0 : _i$key.name) === "string" && !IGNORE_ATTRIBUTES.includes((_i$key2 = i.key) === null || _i$key2 === void 0 || (_i$key2 = _i$key2.name) === null || _i$key2 === void 0 ? void 0 : _i$key2.toLowerCase()) && i.value == null;
|
|
146
|
+
});
|
|
147
|
+
if (!valueless.length) return;
|
|
148
|
+
for (const node$1 of valueless) {
|
|
149
|
+
var _node$key, _context$settings$uno2;
|
|
150
|
+
if (!(node$1 === null || node$1 === void 0 || (_node$key = node$1.key) === null || _node$key === void 0 ? void 0 : _node$key.name)) continue;
|
|
151
|
+
syncAction((_context$settings$uno2 = context.settings.unocss) === null || _context$settings$uno2 === void 0 ? void 0 : _context$settings$uno2.configPath, "blocklist", node$1.key.name, context.filename).forEach(([name, meta]) => {
|
|
152
|
+
context.report({
|
|
153
|
+
node: node$1,
|
|
154
|
+
messageId: "in-blocklist",
|
|
155
|
+
data: {
|
|
156
|
+
name,
|
|
157
|
+
reason: (meta === null || meta === void 0 ? void 0 : meta.message) ? `: ${meta.message}` : ""
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const parserServices = (context === null || context === void 0 ? void 0 : context.sourceCode.parserServices) || context.parserServices;
|
|
165
|
+
if (parserServices == null || parserServices.defineTemplateBodyVisitor == null) return scriptVisitor;
|
|
166
|
+
else return parserServices === null || parserServices === void 0 ? void 0 : parserServices.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor);
|
|
167
|
+
}
|
|
171
168
|
});
|
|
172
169
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
let replacePropertyKeyText = `'${CLASS_COMPILE_PREFIX}${classListString}'`;
|
|
253
|
-
if (property.shorthand)
|
|
254
|
-
replacePropertyKeyText = `${replacePropertyKeyText}: ${classListString}`;
|
|
255
|
-
return fixer.replaceTextRange(property.key.range, replacePropertyKeyText);
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
const parserServices = context?.sourceCode.parserServices || context.parserServices;
|
|
261
|
-
if (parserServices == null || parserServices.defineTemplateBodyVisitor == null) {
|
|
262
|
-
return scriptVisitor;
|
|
263
|
-
} else {
|
|
264
|
-
return parserServices?.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/rules/enforce-class-compile.ts
|
|
172
|
+
var enforce_class_compile_default = createRule({
|
|
173
|
+
name: "enforce-class-compile",
|
|
174
|
+
meta: {
|
|
175
|
+
type: "problem",
|
|
176
|
+
fixable: "code",
|
|
177
|
+
docs: { description: "Enforce class compilation" },
|
|
178
|
+
messages: { missing: "prefix: `{{prefix}}` is missing" },
|
|
179
|
+
schema: [{
|
|
180
|
+
type: "object",
|
|
181
|
+
properties: {
|
|
182
|
+
prefix: { type: "string" },
|
|
183
|
+
enableFix: { type: "boolean" }
|
|
184
|
+
},
|
|
185
|
+
additionalProperties: false
|
|
186
|
+
}]
|
|
187
|
+
},
|
|
188
|
+
defaultOptions: [{
|
|
189
|
+
prefix: ":uno:",
|
|
190
|
+
enableFix: true
|
|
191
|
+
}],
|
|
192
|
+
create(context, [mergedOptions]) {
|
|
193
|
+
const CLASS_COMPILE_PREFIX = `${mergedOptions.prefix} `;
|
|
194
|
+
const ENABLE_FIX = mergedOptions.enableFix;
|
|
195
|
+
function report({ node, fix }) {
|
|
196
|
+
context.report({
|
|
197
|
+
node,
|
|
198
|
+
loc: node.loc,
|
|
199
|
+
messageId: "missing",
|
|
200
|
+
data: { prefix: CLASS_COMPILE_PREFIX.trim() },
|
|
201
|
+
fix: (...args) => ENABLE_FIX ? fix(...args) : null
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
const scriptVisitor = {
|
|
205
|
+
JSXAttribute(_node) {},
|
|
206
|
+
SvelteAttribute(_node) {}
|
|
207
|
+
};
|
|
208
|
+
const reportClassList = (node, classList) => {
|
|
209
|
+
if (classList.startsWith(CLASS_COMPILE_PREFIX)) return;
|
|
210
|
+
report({
|
|
211
|
+
node,
|
|
212
|
+
fix(fixer) {
|
|
213
|
+
return fixer.replaceTextRange([node.range[0] + 1, node.range[1] - 1], `${CLASS_COMPILE_PREFIX}${classList}`);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
const templateBodyVisitor = {
|
|
218
|
+
[`VAttribute[key.name=class]`](attr) {
|
|
219
|
+
const valueNode = attr.value;
|
|
220
|
+
if (!valueNode || !valueNode.value) return;
|
|
221
|
+
reportClassList(valueNode, valueNode.value);
|
|
222
|
+
},
|
|
223
|
+
[`VAttribute[key.argument.name=class] VExpressionContainer Literal:not(ConditionalExpression .test Literal):not(Property .value Literal)`](literal) {
|
|
224
|
+
if (!literal.value || typeof literal.value !== "string") return;
|
|
225
|
+
reportClassList(literal, literal.value);
|
|
226
|
+
},
|
|
227
|
+
[`VAttribute[key.argument.name=class] VExpressionContainer TemplateElement`](templateElement) {
|
|
228
|
+
if (!templateElement.value.raw) return;
|
|
229
|
+
reportClassList(templateElement, templateElement.value.raw);
|
|
230
|
+
},
|
|
231
|
+
[`VAttribute[key.argument.name=class] VExpressionContainer Property`](property) {
|
|
232
|
+
if (property.key.type !== "Identifier") return;
|
|
233
|
+
const classListString = property.key.name;
|
|
234
|
+
if (classListString.startsWith(CLASS_COMPILE_PREFIX)) return;
|
|
235
|
+
report({
|
|
236
|
+
node: property.key,
|
|
237
|
+
fix(fixer) {
|
|
238
|
+
let replacePropertyKeyText = `'${CLASS_COMPILE_PREFIX}${classListString}'`;
|
|
239
|
+
if (property.shorthand) replacePropertyKeyText = `${replacePropertyKeyText}: ${classListString}`;
|
|
240
|
+
return fixer.replaceTextRange(property.key.range, replacePropertyKeyText);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
const parserServices = (context === null || context === void 0 ? void 0 : context.sourceCode.parserServices) || context.parserServices;
|
|
246
|
+
if (parserServices == null || parserServices.defineTemplateBodyVisitor == null) return scriptVisitor;
|
|
247
|
+
else return parserServices === null || parserServices === void 0 ? void 0 : parserServices.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor);
|
|
248
|
+
}
|
|
267
249
|
});
|
|
268
250
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
if (!(node.callee.type === "Identifier" && isUnoFunction(node.callee.name)))
|
|
456
|
-
return;
|
|
457
|
-
node.arguments.forEach((arg) => {
|
|
458
|
-
if (isPossibleLiteral(arg)) {
|
|
459
|
-
return checkPossibleLiteral(arg);
|
|
460
|
-
}
|
|
461
|
-
if (arg.type === "ConditionalExpression") {
|
|
462
|
-
return checkPossibleLiteral(arg.consequent, arg.alternate);
|
|
463
|
-
}
|
|
464
|
-
if (arg.type === "LogicalExpression") {
|
|
465
|
-
return checkPossibleLiteral(arg.left, arg.right);
|
|
466
|
-
}
|
|
467
|
-
function handleObjectExpression(node2) {
|
|
468
|
-
node2.properties.forEach((p) => {
|
|
469
|
-
if (p.type !== "Property")
|
|
470
|
-
return;
|
|
471
|
-
if (isPossibleLiteral(p.value)) {
|
|
472
|
-
return checkPossibleLiteral(p.value);
|
|
473
|
-
}
|
|
474
|
-
if (p.value.type === "ObjectExpression") {
|
|
475
|
-
return handleObjectExpression(p.value);
|
|
476
|
-
}
|
|
477
|
-
});
|
|
478
|
-
const keys = node2.properties.filter((p) => p.type === "Property").map((p) => p.key);
|
|
479
|
-
return checkPossibleLiteral(...keys);
|
|
480
|
-
}
|
|
481
|
-
if (arg.type === "ObjectExpression") {
|
|
482
|
-
return handleObjectExpression(arg);
|
|
483
|
-
}
|
|
484
|
-
if (arg.type === "ArrayExpression") {
|
|
485
|
-
return arg.elements.forEach((element) => {
|
|
486
|
-
if (element && isPossibleLiteral(element)) {
|
|
487
|
-
return checkPossibleLiteral(element);
|
|
488
|
-
}
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
});
|
|
492
|
-
},
|
|
493
|
-
// https://typescript-eslint.io/play/#ts=5.8.2&showAST=es&fileType=.tsx&code=MYewdgzgLgBApgDygJwIYGEA2qIQHKoC2cMAvDAOQBeAtAIwAMDFAUCwPTswBuqyAlqgBGmEgBM4wbGij9wLUJFhSIAIQCuUKODKVCyeq0XQYKjVvAAmXQAN99GABIA3ohQZsuAsQC%2BNheAmZpraYADMtvZ0Tq5IaFg4%2BERwfjA4poFQbJwwIEIAVpKwElJ8qLLyxrBCUGAJXskQus4sMDASAGao6phQAFx6mDSWAA4IFAA0rTAA7vxQABYAonGoAzYdoggw83CEEDTAcGBQcMgwQgDmNDMLuzCnSDQiqMAA1jFu8Z5JvjZTbQQAxabTaAE8BhRCENRuNpj4WAiOFx0lV2pJpOU5GAAkoLrV6r84BBrOQQeiuj1%2BoNhmNJtMgTByeDIdDaXC2gifGkmlUgA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
|
|
494
|
-
VariableDeclarator(node) {
|
|
495
|
-
if (node.id.type !== "Identifier" || !node.init || !isUnoVariable(node.id.name))
|
|
496
|
-
return;
|
|
497
|
-
if (isPossibleLiteral(node.init)) {
|
|
498
|
-
return checkPossibleLiteral(node.init);
|
|
499
|
-
}
|
|
500
|
-
if (node.init.type === "TSAsExpression" && isPossibleLiteral(node.init.expression)) {
|
|
501
|
-
return checkPossibleLiteral(node.init.expression);
|
|
502
|
-
}
|
|
503
|
-
function handleObjectExpression(node2) {
|
|
504
|
-
node2.properties.forEach((p) => {
|
|
505
|
-
if (p.type !== "Property")
|
|
506
|
-
return;
|
|
507
|
-
if (isPossibleLiteral(p.value)) {
|
|
508
|
-
return checkPossibleLiteral(p.value);
|
|
509
|
-
}
|
|
510
|
-
if (p.value.type === "ObjectExpression") {
|
|
511
|
-
return handleObjectExpression(p.value);
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
if (node.init.type === "ObjectExpression") {
|
|
516
|
-
return handleObjectExpression(node.init);
|
|
517
|
-
}
|
|
518
|
-
if (node.init.type === "TSAsExpression" && node.init.expression.type === "ObjectExpression") {
|
|
519
|
-
return handleObjectExpression(node.init.expression);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
const templateBodyVisitor = {
|
|
524
|
-
VAttribute(node) {
|
|
525
|
-
if (node.key.name === "class") {
|
|
526
|
-
if (node.value.type === "VLiteral")
|
|
527
|
-
checkLiteral(node.value);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
const parserServices = context?.sourceCode.parserServices || context.parserServices;
|
|
532
|
-
if (parserServices == null || parserServices.defineTemplateBodyVisitor == null) {
|
|
533
|
-
return scriptVisitor;
|
|
534
|
-
} else {
|
|
535
|
-
return parserServices?.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/rules/order.ts
|
|
253
|
+
var order_default = createRule({
|
|
254
|
+
name: "order",
|
|
255
|
+
meta: {
|
|
256
|
+
type: "layout",
|
|
257
|
+
fixable: "code",
|
|
258
|
+
docs: { description: "Order of UnoCSS utilities in class attribute" },
|
|
259
|
+
messages: { "invalid-order": "UnoCSS utilities are not ordered" },
|
|
260
|
+
schema: [{
|
|
261
|
+
type: "object",
|
|
262
|
+
properties: {
|
|
263
|
+
unoFunctions: {
|
|
264
|
+
type: "array",
|
|
265
|
+
items: { type: "string" }
|
|
266
|
+
},
|
|
267
|
+
unoVariables: {
|
|
268
|
+
type: "array",
|
|
269
|
+
items: { type: "string" }
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
additionalProperties: false
|
|
273
|
+
}]
|
|
274
|
+
},
|
|
275
|
+
defaultOptions: [{
|
|
276
|
+
unoFunctions: ["clsx", "classnames"],
|
|
277
|
+
unoVariables: ["^cls", "classNames?$"]
|
|
278
|
+
}],
|
|
279
|
+
create(context) {
|
|
280
|
+
let { unoFunctions = ["clsx", "classnames"], unoVariables = ["^cls", "classNames?$"] } = context.options[0] || {};
|
|
281
|
+
unoFunctions = unoFunctions.map((name) => name.toLowerCase());
|
|
282
|
+
function isUnoFunction(name) {
|
|
283
|
+
return unoFunctions.includes(name.toLowerCase());
|
|
284
|
+
}
|
|
285
|
+
const unoVariablesRegexes = unoVariables.map((regex) => new RegExp(regex, "i"));
|
|
286
|
+
function isUnoVariable(name) {
|
|
287
|
+
return unoVariablesRegexes.some((reg) => reg.test(name));
|
|
288
|
+
}
|
|
289
|
+
function checkLiteral(node, addSpace) {
|
|
290
|
+
var _context$settings$uno;
|
|
291
|
+
if (typeof node.value !== "string" || !node.value.trim()) return;
|
|
292
|
+
const input = node.value;
|
|
293
|
+
let sorted = syncAction((_context$settings$uno = context.settings.unocss) === null || _context$settings$uno === void 0 ? void 0 : _context$settings$uno.configPath, "sort", input, context.filename).trim();
|
|
294
|
+
if (addSpace === "before") sorted = ` ${sorted}`;
|
|
295
|
+
else if (addSpace === "after") sorted += " ";
|
|
296
|
+
if (sorted !== input) {
|
|
297
|
+
const nodeOrToken = node.type === "SvelteLiteral" ? {
|
|
298
|
+
type: _typescript_eslint_types.AST_TOKEN_TYPES.String,
|
|
299
|
+
value: node.value,
|
|
300
|
+
loc: node.loc,
|
|
301
|
+
range: node.range
|
|
302
|
+
} : node;
|
|
303
|
+
context.report({
|
|
304
|
+
node: nodeOrToken,
|
|
305
|
+
loc: node.loc,
|
|
306
|
+
messageId: "invalid-order",
|
|
307
|
+
fix(fixer) {
|
|
308
|
+
if (AST_NODES_WITH_QUOTES.includes(node.type)) return fixer.replaceTextRange([node.range[0] + 1, node.range[1] - 1], sorted);
|
|
309
|
+
else return fixer.replaceText(nodeOrToken, sorted);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function checkTemplateElement(quasi) {
|
|
315
|
+
var _context$settings$uno2;
|
|
316
|
+
const input = quasi.value.raw;
|
|
317
|
+
if (!input) return;
|
|
318
|
+
const getRange = () => {
|
|
319
|
+
const text = context.sourceCode.getText(quasi);
|
|
320
|
+
const raw = quasi.value.raw;
|
|
321
|
+
if (!text.includes(raw)) return;
|
|
322
|
+
const rawStart = text.indexOf(raw);
|
|
323
|
+
const start = quasi.range[0] + rawStart;
|
|
324
|
+
const end = quasi.range[0] + rawStart + raw.length;
|
|
325
|
+
if (start < quasi.range[0] || end > quasi.range[1]) return;
|
|
326
|
+
return [start, end];
|
|
327
|
+
};
|
|
328
|
+
if (!getRange()) return;
|
|
329
|
+
let sorted = syncAction((_context$settings$uno2 = context.settings.unocss) === null || _context$settings$uno2 === void 0 ? void 0 : _context$settings$uno2.configPath, "sort", input, context.filename).trim();
|
|
330
|
+
if (/^\s/.test(input)) sorted = ` ${sorted}`;
|
|
331
|
+
if (/\s$/.test(input)) sorted += " ";
|
|
332
|
+
if (sorted !== input) context.report({
|
|
333
|
+
node: quasi,
|
|
334
|
+
loc: quasi.loc,
|
|
335
|
+
messageId: "invalid-order",
|
|
336
|
+
fix(fixer) {
|
|
337
|
+
const realRange = getRange();
|
|
338
|
+
if (!realRange) return null;
|
|
339
|
+
return fixer.replaceTextRange(realRange, sorted);
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
function isPossibleLiteral(node) {
|
|
344
|
+
return node.type === "Literal" || node.type === "TemplateLiteral" || node.type === "TaggedTemplateExpression";
|
|
345
|
+
}
|
|
346
|
+
function checkPossibleLiteral(...nodes) {
|
|
347
|
+
nodes.forEach((node) => {
|
|
348
|
+
if (!isPossibleLiteral(node)) return;
|
|
349
|
+
if (node.type === "Literal" && typeof node.value === "string") return checkLiteral(node);
|
|
350
|
+
const isSimpleTemplateLiteral = (node$1) => {
|
|
351
|
+
return node$1.expressions.length === 0 && node$1.quasis.length === 1;
|
|
352
|
+
};
|
|
353
|
+
if (node.type === "TemplateLiteral" && isSimpleTemplateLiteral(node)) return checkTemplateElement(node.quasis[0]);
|
|
354
|
+
const isStringRaw = (tag) => {
|
|
355
|
+
return tag.type === "MemberExpression" && tag.object.type === "Identifier" && tag.object.name === "String" && tag.property.type === "Identifier" && tag.property.name === "raw";
|
|
356
|
+
};
|
|
357
|
+
if (node.type === "TaggedTemplateExpression" && isStringRaw(node.tag) && isSimpleTemplateLiteral(node.quasi)) return checkTemplateElement(node.quasi.quasis[0]);
|
|
358
|
+
if (node.type === "TemplateLiteral" && node.expressions.length > 0 && node.quasis.length > 0) {
|
|
359
|
+
node.quasis.forEach((quasi) => {
|
|
360
|
+
checkTemplateElement(quasi);
|
|
361
|
+
});
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
const scriptVisitor = {
|
|
367
|
+
JSXAttribute(node) {
|
|
368
|
+
if (typeof node.name.name === "string" && CLASS_FIELDS.includes(node.name.name.toLowerCase()) && node.value) {
|
|
369
|
+
if (isPossibleLiteral(node.value)) return checkPossibleLiteral(node.value);
|
|
370
|
+
else if (node.value.type === "JSXExpressionContainer" && isPossibleLiteral(node.value.expression)) return checkPossibleLiteral(node.value.expression);
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
SvelteAttribute(node) {
|
|
374
|
+
if (node.key.name === "class") {
|
|
375
|
+
if (!node.value.length) return;
|
|
376
|
+
function checkExpressionRecursively(expression) {
|
|
377
|
+
if (expression.type !== "ConditionalExpression") return;
|
|
378
|
+
if (expression.consequent.type === "Literal") checkLiteral(expression.consequent);
|
|
379
|
+
if (expression.alternate) {
|
|
380
|
+
if (expression.alternate.type === "ConditionalExpression") checkExpressionRecursively(expression.alternate);
|
|
381
|
+
else if (expression.alternate.type === "Literal") checkLiteral(expression.alternate);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
node.value.forEach((obj, i) => {
|
|
385
|
+
if (obj.type === "SvelteMustacheTag") checkExpressionRecursively(obj.expression);
|
|
386
|
+
else if (obj.type === "SvelteLiteral") {
|
|
387
|
+
var _node$value, _node$value2;
|
|
388
|
+
checkLiteral(obj, ((_node$value = node.value) === null || _node$value === void 0 || (_node$value = _node$value[i - 1]) === null || _node$value === void 0 ? void 0 : _node$value.type) === "SvelteMustacheTag" ? "before" : ((_node$value2 = node.value) === null || _node$value2 === void 0 || (_node$value2 = _node$value2[i + 1]) === null || _node$value2 === void 0 ? void 0 : _node$value2.type) === "SvelteMustacheTag" ? "after" : void 0);
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
CallExpression(node) {
|
|
394
|
+
if (!(node.callee.type === "Identifier" && isUnoFunction(node.callee.name))) return;
|
|
395
|
+
node.arguments.forEach((arg) => {
|
|
396
|
+
if (isPossibleLiteral(arg)) return checkPossibleLiteral(arg);
|
|
397
|
+
if (arg.type === "ConditionalExpression") return checkPossibleLiteral(arg.consequent, arg.alternate);
|
|
398
|
+
if (arg.type === "LogicalExpression") return checkPossibleLiteral(arg.left, arg.right);
|
|
399
|
+
function handleObjectExpression(node$1) {
|
|
400
|
+
node$1.properties.forEach((p) => {
|
|
401
|
+
if (p.type !== "Property") return;
|
|
402
|
+
if (isPossibleLiteral(p.value)) return checkPossibleLiteral(p.value);
|
|
403
|
+
if (p.value.type === "ObjectExpression") return handleObjectExpression(p.value);
|
|
404
|
+
});
|
|
405
|
+
return checkPossibleLiteral(...node$1.properties.filter((p) => p.type === "Property").map((p) => p.key));
|
|
406
|
+
}
|
|
407
|
+
if (arg.type === "ObjectExpression") return handleObjectExpression(arg);
|
|
408
|
+
if (arg.type === "ArrayExpression") return arg.elements.forEach((element) => {
|
|
409
|
+
if (element && isPossibleLiteral(element)) return checkPossibleLiteral(element);
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
},
|
|
413
|
+
VariableDeclarator(node) {
|
|
414
|
+
if (node.id.type !== "Identifier" || !node.init || !isUnoVariable(node.id.name)) return;
|
|
415
|
+
if (isPossibleLiteral(node.init)) return checkPossibleLiteral(node.init);
|
|
416
|
+
if (node.init.type === "TSAsExpression" && isPossibleLiteral(node.init.expression)) return checkPossibleLiteral(node.init.expression);
|
|
417
|
+
function handleObjectExpression(node$1) {
|
|
418
|
+
node$1.properties.forEach((p) => {
|
|
419
|
+
if (p.type !== "Property") return;
|
|
420
|
+
if (isPossibleLiteral(p.value)) return checkPossibleLiteral(p.value);
|
|
421
|
+
if (p.value.type === "ObjectExpression") return handleObjectExpression(p.value);
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
if (node.init.type === "ObjectExpression") return handleObjectExpression(node.init);
|
|
425
|
+
if (node.init.type === "TSAsExpression" && node.init.expression.type === "ObjectExpression") return handleObjectExpression(node.init.expression);
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
const templateBodyVisitor = { VAttribute(node) {
|
|
429
|
+
if (node.key.name === "class") {
|
|
430
|
+
if (node.value.type === "VLiteral") checkLiteral(node.value);
|
|
431
|
+
}
|
|
432
|
+
} };
|
|
433
|
+
const parserServices = (context === null || context === void 0 ? void 0 : context.sourceCode.parserServices) || context.parserServices;
|
|
434
|
+
if (parserServices == null || parserServices.defineTemplateBodyVisitor == null) return scriptVisitor;
|
|
435
|
+
else return parserServices === null || parserServices === void 0 ? void 0 : parserServices.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor);
|
|
436
|
+
}
|
|
538
437
|
});
|
|
539
438
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
};
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/plugin.ts
|
|
441
|
+
const plugin = { rules: {
|
|
442
|
+
order: order_default,
|
|
443
|
+
"order-attributify": order_attributify_default,
|
|
444
|
+
blocklist: blocklist_default,
|
|
445
|
+
"enforce-class-compile": enforce_class_compile_default
|
|
446
|
+
} };
|
|
548
447
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
448
|
+
//#endregion
|
|
449
|
+
//#region src/configs/flat.ts
|
|
450
|
+
var flat_default = {
|
|
451
|
+
plugins: { unocss: plugin },
|
|
452
|
+
rules: {
|
|
453
|
+
"unocss/order": "warn",
|
|
454
|
+
"unocss/order-attributify": "warn"
|
|
455
|
+
}
|
|
557
456
|
};
|
|
558
457
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region src/configs/recommended.ts
|
|
460
|
+
var recommended_default = {
|
|
461
|
+
plugins: ["@unocss"],
|
|
462
|
+
rules: {
|
|
463
|
+
"@unocss/order": "warn",
|
|
464
|
+
"@unocss/order-attributify": "warn"
|
|
465
|
+
}
|
|
565
466
|
};
|
|
566
467
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region src/index.ts
|
|
470
|
+
const configs = {
|
|
471
|
+
recommended: recommended_default,
|
|
472
|
+
flat: flat_default
|
|
473
|
+
};
|
|
474
|
+
var src_default = {
|
|
475
|
+
...plugin,
|
|
476
|
+
configs
|
|
573
477
|
};
|
|
574
478
|
|
|
575
|
-
|
|
479
|
+
//#endregion
|
|
480
|
+
exports.__toESM = __toESM;
|
|
481
|
+
exports.configs = configs;
|
|
482
|
+
exports.default = src_default;
|