oxlint-tailwindcss 1.3.4 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -205,11 +205,12 @@ Output:
205
205
  ```
206
206
 
207
207
  If no entry point is configured, the DS-dependent rules (`no-unknown-classes`,
208
- `no-conflicting-classes`, `no-deprecated-classes`, `enforce-canonical`, `enforce-sort-order`,
208
+ `no-conflicting-classes`, `enforce-canonical`, `enforce-sort-order`,
209
209
  `no-unnecessary-arbitrary-value`, `prefer-theme-tokens`) emit a single `designSystemUnavailable`
210
- diagnostic per file with an actionable hint — no more silent skips. `consistent-variant-order` is
211
- the lone exception: its static fallback is itself deterministic, so a missing entryPoint is
212
- tolerated there. All non-DS rules work without an entry point.
210
+ diagnostic per file with an actionable hint — no more silent skips. `consistent-variant-order`
211
+ tolerates a missing entryPoint (its static fallback is itself deterministic), and
212
+ `no-deprecated-classes` needs no design system at all (it only consults a hardcoded v3→v4 rename
213
+ map). All non-DS rules work without an entry point.
213
214
 
214
215
  ## Custom class detection
215
216
 
@@ -378,17 +379,21 @@ duplicates (different variants).
378
379
 
379
380
  #### `no-conflicting-classes`
380
381
 
381
- Detects classes that set the same CSS property. Reports which property conflicts and which class
382
- wins.
382
+ Detects classes whose CSS declarations clash, by comparing the CSS the design system actually emits
383
+ — values included, not just property names. Reports which property clashes and which class wins,
384
+ asked of the design system rather than inferred from the order you wrote the classes in.
385
+
386
+ Two classes that declare the same property with the SAME value are reported separately, as
387
+ `redundant`: not a conflict, but one of them is dead weight. Set `reportRedundant: false` to opt
388
+ out.
383
389
 
384
390
  ```tsx
385
391
  // ❌ Bad
386
392
  <div className="text-red-500 text-blue-500" />
387
- // "text-red-500" and "text-blue-500" affect "color".
388
- // "text-blue-500" takes precedence (appears later).
393
+ // "text-red-500" overrides "text-blue-500" on "color".
389
394
 
390
395
  <div className="mt-2 mt-4" />
391
- // "mt-2" and "mt-4" affect "margin-top".
396
+ // "mt-4" overrides "mt-2" on "margin-top".
392
397
  ```
393
398
 
394
399
  > **Note:** Shorthand vs longhand conflicts (e.g., `p-4` vs `px-2`) are not currently detected. See
@@ -936,14 +941,15 @@ The class parser correctly handles:
936
941
  forms (`p-[2px]`, `bg-(--c)`) are canonicalized dynamically via the worker. Some valid v4 classes
937
942
  that don't appear in `getClassList()` and have no canonical rewrite (e.g. `border-1` is valid as a
938
943
  dynamic numeric value but isn't enumerated) are left untouched.
939
- - **`no-conflicting-classes`**: Uses exact CSS property name matching plus composition heuristics:
940
- CSS-var composition (`shadow` + `ring`), narrowing-override (later class is a strict subset of
941
- earlier — handles `size-4 h-6`, `rounded-t-lg rounded-tl-sm`, `truncate text-clip`), complementary
942
- groups (gradient stops, transition family, transform axes, mask gradient family across
943
- edges/axes/`linear`/`radial`/`conic`), and composition pairs (e.g. `mask-add` + any mask
944
- gradient). Shorthand vs longhand cases where Tailwind emits the shorthand and Tailwind's longhand
945
- has a different CSS property name (e.g., `p-4` vs `px-2`: `padding` vs
946
- `padding-left`/`padding-right`) are still not detected.
944
+ - **`no-conflicting-classes`**: compares the emitted declarations (property, value, the custom
945
+ properties each value reads, and which box it applies to), so compositions are derived rather than
946
+ enumerated. Two exceptions cannot be derived and stay declared in the source: `prose` variants and
947
+ `prose` + `max-w-*` (the plugin intends the override, and the CSS looks identical to an accident),
948
+ and `mask-composite` modes. Use the `allow` option for a composition your own plugins produce.
949
+ Still not detected: shorthand vs longhand under different property names (`p-4` vs `px-2` —
950
+ `padding` vs `padding-left`/`padding-right`), and, for classes whose value you wrote (`w-[10px]`),
951
+ the stylesheet position is unknowable, so those diagnostics report the clash without naming a
952
+ winner.
947
953
  - **`no-dark-without-light`**: Groups by utility prefix heuristic. May not perfectly match all
948
954
  multi-part utility prefixes.
949
955
  - **`no-unnecessary-arbitrary-value`**: Only detects equivalences for classes with a single CSS
@@ -958,15 +964,17 @@ point — `@plugin '...'` or `@import '...'` — is recognized automatically by
958
964
  following are exercised by the test suite:
959
965
 
960
966
  - **[`@tailwindcss/typography`](https://github.com/tailwindlabs/tailwindcss-typography)** — `prose`,
961
- `prose-sm/lg/xl`, `not-prose`. `no-conflicting-classes` extracts only root-level CSS properties
962
- from `prose`, so utilities like `prose overflow-x-auto` aren't reported as conflicts.
967
+ `prose-sm/lg/xl`, `not-prose`. `prose` styles both itself and its descendants, and
968
+ `no-conflicting-classes` only compares what a class declares on its own box, so
969
+ `prose overflow-x-auto` is not a conflict.
963
970
  - **[`tailwindcss-animate`](https://github.com/jamiebuilds/tailwindcss-animate)** — `animate-in`,
964
971
  `animate-out`, `fade-{in,out}-*`, `zoom-{in,out}-*`, `spin-{in,out}-*`,
965
972
  `slide-{in-from,out-to}-*`, `duration-*`, `delay-*`, `ease-*`, `direction-*`, `fill-mode-*`,
966
973
  `repeat-*`, `running`, `paused`. `animate-in`/`animate-out` initialize all `--tw-enter-*` /
967
974
  `--tw-exit-*` custom properties to `initial`, and modifiers (`fade-in`, `zoom-in`,
968
- `slide-in-from-*`, etc.) each override one of them; this composition is recognized by
969
- `no-conflicting-classes`.
975
+ `slide-in-from-*`, etc.) each override one of them. `no-conflicting-classes` derives that from the
976
+ emitted CSS — a custom property reset to `initial` carries no information — so it holds for any
977
+ plugin built the same way, not just these two.
970
978
  - **[`tw-animate-css`](https://github.com/Wombosvideo/tw-animate-css)** — v4-native rewrite of
971
979
  `tailwindcss-animate`. Adds `blur-{in,out}-*`, logical (RTL-aware)
972
980
  `slide-{in-from,out-to}-{start,end}-*`, `play-state-*`, `animation-duration-*`, and the