Skip to content

Commit ddee4c6

Browse files
Apply suggestions from code review
Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
1 parent 6b28e58 commit ddee4c6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111

12-
- Don't migrate important modifiers when these are used inside conditionals of certain template languages (e.g. `<div v-if="!border"/>`) ([#14774](https://github.com/tailwindlabs/tailwindcss/pull/14774))
12+
- Don't migrate important modifiers inside conditional statements in Vue and Alpine (e.g. `<div v-if="!border" />`) ([#14774](https://github.com/tailwindlabs/tailwindcss/pull/14774))
1313

1414
## [4.0.0-alpha.29] - 2024-10-23
1515

packages/@tailwindcss-upgrade/src/template/codemods/important.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function important(
6363
currentLineAfterCandidate += char
6464
}
6565

66-
// Heuristics 1: Require the candidate to be inside quotes
66+
// Heuristic 1: Require the candidate to be inside quotes
6767
let isQuoteBeforeCandidate = QUOTES.some((quote) =>
6868
currentLineBeforeCandidate.includes(quote),
6969
)
@@ -74,12 +74,12 @@ export function important(
7474
continue nextCandidate
7575
}
7676

77-
// Heuristics 2: Disallow object access immediately following the candidate
77+
// Heuristic 2: Disallow object access immediately following the candidate
7878
if (currentLineAfterCandidate[0] === '.') {
7979
continue nextCandidate
8080
}
8181

82-
// Heuristics 3: Disallow logical operators proceeding or following the candidate
82+
// Heuristic 3: Disallow logical operators preceding or following the candidate
8383
for (let operator of LOGICAL_OPERATORS) {
8484
if (
8585
currentLineAfterCandidate.trim().startsWith(operator) ||
@@ -89,7 +89,7 @@ export function important(
8989
}
9090
}
9191

92-
// Heuristics 4: Disallow conditional template syntax
92+
// Heuristic 4: Disallow conditional template syntax
9393
for (let rule of CONDITIONAL_TEMPLATE_SYNTAX) {
9494
if (rule.test(currentLineBeforeCandidate)) {
9595
continue nextCandidate

0 commit comments

Comments
 (0)