Fix recommended variant order linting in Tailwind v2 (#849)
parent
bac7e2e564
commit
401a306e16
|
@ -30,10 +30,9 @@ export async function getRecommendedVariantOrderDiagnostics(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let order = state.jitContext.variantOrder ?? state.jitContext.offsets.variantOffsets
|
||||||
let { variants, offset } = getVariantsFromClassName(state, className.className)
|
let { variants, offset } = getVariantsFromClassName(state, className.className)
|
||||||
let sortedVariants = [...variants].sort((a, b) =>
|
let sortedVariants = [...variants].sort((a, b) => jit.bigSign(order.get(b) - order.get(a)))
|
||||||
jit.bigSign(state.jitContext.variantOrder.get(b) - state.jitContext.variantOrder.get(a))
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!equalExact(variants, sortedVariants)) {
|
if (!equalExact(variants, sortedVariants)) {
|
||||||
diagnostics.push({
|
diagnostics.push({
|
||||||
|
|
Loading…
Reference in New Issue