Skip to content

Commit

Permalink
Merge pull request #292 from 0Miles/dev/beta
Browse files Browse the repository at this point in the history
Update ESLint
  • Loading branch information
0Miles authored Oct 25, 2023
2 parents 89039fe + 5ca326c commit f1185c0
Show file tree
Hide file tree
Showing 2 changed files with 421 additions and 3 deletions.
9 changes: 7 additions & 2 deletions packages/eslint-plugin/lib/rules/class-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,13 @@ module.exports = {
const w = whitespaces[i] ?? ''
const cls = orderedClassNames[i]
validatedClassNamesValue += headSpace ? `${w}${cls}` : `${cls}${w}`
if (headSpace && tailSpace && i === orderedClassNames.length - 1) {
validatedClassNamesValue += whitespaces[whitespaces.length - 1] ?? ''
if (cls) {
if (!tailSpace && i === orderedClassNames.length - 1) {
validatedClassNamesValue = validatedClassNamesValue.replace(/\s+$/, '')
}
if (headSpace && tailSpace && i === orderedClassNames.length - 1) {
validatedClassNamesValue += whitespaces[whitespaces.length - 1] ?? ''
}
}
}

Expand Down
Loading

0 comments on commit f1185c0

Please sign in to comment.