oxlint-tailwindcss 0.6.0 → 0.6.2
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/README.md +1 -1
- package/dist/index.cjs +19 -4
- package/dist/index.mjs +19 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -652,7 +652,7 @@ Does NOT convert complex expressions — only simple `var(--name)` wrappers:
|
|
|
652
652
|
|
|
653
653
|
Enforces a consistent order for variant prefixes.
|
|
654
654
|
|
|
655
|
-
Uses the design system's variant order when available, falls back to a sensible static default. Only checks classes with 2+ variants.
|
|
655
|
+
Uses the design system's variant order when available, falls back to a sensible static default. Only checks classes with 2+ variants. Pseudo-element variants (`before:`, `after:`, `placeholder:`, etc.) are always kept innermost (closest to the utility) regardless of the ordering source — placing them before element-selecting variants like `[&>svg]:` or `has-[.active]:` produces broken CSS in Tailwind v4.
|
|
656
656
|
|
|
657
657
|
**Options:**
|
|
658
658
|
|
package/dist/index.cjs
CHANGED
|
@@ -1917,7 +1917,6 @@ function ensureService$1(cssPath) {
|
|
|
1917
1917
|
cleanup$1();
|
|
1918
1918
|
return false;
|
|
1919
1919
|
}
|
|
1920
|
-
process.on("exit", cleanup$1);
|
|
1921
1920
|
return true;
|
|
1922
1921
|
} catch {
|
|
1923
1922
|
available$1 = false;
|
|
@@ -2188,7 +2187,6 @@ function ensureService(cssPath) {
|
|
|
2188
2187
|
cleanup();
|
|
2189
2188
|
return false;
|
|
2190
2189
|
}
|
|
2191
|
-
process.on("exit", cleanup);
|
|
2192
2190
|
return true;
|
|
2193
2191
|
} catch {
|
|
2194
2192
|
available = false;
|
|
@@ -3325,6 +3323,18 @@ const noContradictingVariants = (0, _oxlint_plugins.defineRule)({
|
|
|
3325
3323
|
});
|
|
3326
3324
|
//#endregion
|
|
3327
3325
|
//#region src/rules/consistent-variant-order.ts
|
|
3326
|
+
const PSEUDO_ELEMENTS = new Set([
|
|
3327
|
+
"before",
|
|
3328
|
+
"after",
|
|
3329
|
+
"file",
|
|
3330
|
+
"placeholder",
|
|
3331
|
+
"selection",
|
|
3332
|
+
"marker",
|
|
3333
|
+
"backdrop",
|
|
3334
|
+
"first-line",
|
|
3335
|
+
"first-letter",
|
|
3336
|
+
"details-content"
|
|
3337
|
+
]);
|
|
3328
3338
|
const DEFAULT_VARIANT_ORDER = [
|
|
3329
3339
|
"*",
|
|
3330
3340
|
"**",
|
|
@@ -3470,9 +3480,14 @@ const consistentVariantOrder = (0, _oxlint_plugins.defineRule)({
|
|
|
3470
3480
|
const variants = extractVariants(cls);
|
|
3471
3481
|
if (variants.length < 2) return null;
|
|
3472
3482
|
const sorted = [...variants].sort((a, b) => getVariantPriority(a) - getVariantPriority(b));
|
|
3473
|
-
|
|
3483
|
+
const nonPseudo = [];
|
|
3484
|
+
const pseudo = [];
|
|
3485
|
+
for (const v of sorted) if (PSEUDO_ELEMENTS.has(v)) pseudo.push(v);
|
|
3486
|
+
else nonPseudo.push(v);
|
|
3487
|
+
const final = nonPseudo.length > 0 && pseudo.length > 0 ? [...nonPseudo, ...pseudo] : sorted;
|
|
3488
|
+
if (variants.every((v, i) => v === final[i])) return null;
|
|
3474
3489
|
const utility = extractUtility(cls);
|
|
3475
|
-
return
|
|
3490
|
+
return final.join(":") + ":" + utility;
|
|
3476
3491
|
}
|
|
3477
3492
|
function check(locations) {
|
|
3478
3493
|
for (const loc of locations) {
|
package/dist/index.mjs
CHANGED
|
@@ -1921,7 +1921,6 @@ function ensureService$1(cssPath) {
|
|
|
1921
1921
|
cleanup$1();
|
|
1922
1922
|
return false;
|
|
1923
1923
|
}
|
|
1924
|
-
process.on("exit", cleanup$1);
|
|
1925
1924
|
return true;
|
|
1926
1925
|
} catch {
|
|
1927
1926
|
available$1 = false;
|
|
@@ -2192,7 +2191,6 @@ function ensureService(cssPath) {
|
|
|
2192
2191
|
cleanup();
|
|
2193
2192
|
return false;
|
|
2194
2193
|
}
|
|
2195
|
-
process.on("exit", cleanup);
|
|
2196
2194
|
return true;
|
|
2197
2195
|
} catch {
|
|
2198
2196
|
available = false;
|
|
@@ -3329,6 +3327,18 @@ const noContradictingVariants = defineRule({
|
|
|
3329
3327
|
});
|
|
3330
3328
|
//#endregion
|
|
3331
3329
|
//#region src/rules/consistent-variant-order.ts
|
|
3330
|
+
const PSEUDO_ELEMENTS = new Set([
|
|
3331
|
+
"before",
|
|
3332
|
+
"after",
|
|
3333
|
+
"file",
|
|
3334
|
+
"placeholder",
|
|
3335
|
+
"selection",
|
|
3336
|
+
"marker",
|
|
3337
|
+
"backdrop",
|
|
3338
|
+
"first-line",
|
|
3339
|
+
"first-letter",
|
|
3340
|
+
"details-content"
|
|
3341
|
+
]);
|
|
3332
3342
|
const DEFAULT_VARIANT_ORDER = [
|
|
3333
3343
|
"*",
|
|
3334
3344
|
"**",
|
|
@@ -3474,9 +3484,14 @@ const consistentVariantOrder = defineRule({
|
|
|
3474
3484
|
const variants = extractVariants(cls);
|
|
3475
3485
|
if (variants.length < 2) return null;
|
|
3476
3486
|
const sorted = [...variants].sort((a, b) => getVariantPriority(a) - getVariantPriority(b));
|
|
3477
|
-
|
|
3487
|
+
const nonPseudo = [];
|
|
3488
|
+
const pseudo = [];
|
|
3489
|
+
for (const v of sorted) if (PSEUDO_ELEMENTS.has(v)) pseudo.push(v);
|
|
3490
|
+
else nonPseudo.push(v);
|
|
3491
|
+
const final = nonPseudo.length > 0 && pseudo.length > 0 ? [...nonPseudo, ...pseudo] : sorted;
|
|
3492
|
+
if (variants.every((v, i) => v === final[i])) return null;
|
|
3478
3493
|
const utility = extractUtility(cls);
|
|
3479
|
-
return
|
|
3494
|
+
return final.join(":") + ":" + utility;
|
|
3480
3495
|
}
|
|
3481
3496
|
function check(locations) {
|
|
3482
3497
|
for (const loc of locations) {
|