diff --git a/lib/rules/enforces-shorthand.js b/lib/rules/enforces-shorthand.js index 1fcc366d..e7703c32 100644 --- a/lib/rules/enforces-shorthand.js +++ b/lib/rules/enforces-shorthand.js @@ -434,7 +434,7 @@ module.exports = { const w = whitespaces[i] ?? ''; const cls = union[i]; validatedClassNamesValue += headSpace ? `${w}${cls}` : isLast ? `${cls}` : `${cls}${w}`; - if (headSpace && tailSpace && isLast) { + if (tailSpace && isLast) { validatedClassNamesValue += whitespaces[whitespaces.length - 1] ?? ''; } } diff --git a/tests/lib/rules/enforces-shorthand.js b/tests/lib/rules/enforces-shorthand.js index d14368b8..8d143476 100644 --- a/tests/lib/rules/enforces-shorthand.js +++ b/tests/lib/rules/enforces-shorthand.js @@ -691,6 +691,26 @@ ruleTester.run("shorthands", rule, { `, errors: [generateError(["overflow-hidden", "text-ellipsis", "whitespace-nowrap"], "truncate")], }, + { + code: "