Skip to content

Commit

Permalink
fix: fixing loop when lines wrap on two lines immediately but was the…
Browse files Browse the repository at this point in the history
…oretically short enough to not wrap (#61)
  • Loading branch information
schoero authored Nov 7, 2024
1 parent 316793f commit fb9060d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/rules/tailwind-multiline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,15 @@ function lintLiterals(ctx: Rule.RuleContext, literals: Literal[]) {
// skip line wrapping if it is not necessary
skip:{

// disallow skipping if line count is not 3
if(multilineClasses.length !== 3){
// disallow skipping if class string contains multiple groups
if(groupedClasses && groupedClasses.length > 1){
break skip;
}

// disallow skipping if the original literal was longer than the printWidth
if(
literalStartPosition + singlelineClasses.line.length > printWidth && printWidth !== 0 ||
singlelineClasses.line.classCount > classesPerLine && classesPerLine !== 0){
break skip;
}

Expand Down

0 comments on commit fb9060d

Please sign in to comment.