tailwindcss/integrations
philipp-spiess 338a78050a Upgrade: Reduce number of false-positive migrations of the important modifier (#14737)
The important candidate migration is one of the most broad we have since it matches for any utility that are prefixed with an exclamation mark.

When running the codemodes on our example projects, we noticed that this was instead creating false-positives with candidates used in code positions, e.g:

```ts
export default {
  shouldNotUse: !border.shouldUse,
}
```

To prevent false-positives, this PR adds a heuristics to detect wether or not a candidate is used in a non-code position. We do this by checking the character before and after the modifier and only allow quotes or spaces.

This can cause candidates to not migrate that are valid Tailwind CSS classes, e.g.:

```ts
let classNames = `!underline${isHovered ? ' font-bold' : ''}`
```

This, however, is not a big issue since v4 can parse the v3 important prefix too.
2024-10-22 16:24:30 +00:00
..
cli Ensure changes to the input CSS file result in a full rebuild (#14744) 2024-10-21 20:29:33 +00:00
postcss Improve @tailwindcss/postcss performance for initial builds (#14565) 2024-10-03 16:21:54 +02:00
upgrade Upgrade: Reduce number of false-positive migrations of the important modifier (#14737) 2024-10-22 16:24:30 +00:00
vite Vite: Fix issues when loading files via static asset queries (#14716) 2024-10-22 16:03:07 +00:00
package.json Add integration test setup and tests for the Vite integration (#14089) 2024-08-02 11:50:49 +02:00
utils.ts Add simple JS config migration (#14639) 2024-10-11 15:27:53 +02:00