oxlint-tailwindcss 1.3.5 → 1.5.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
@@ -379,17 +379,21 @@ duplicates (different variants).
379
379
 
380
380
  #### `no-conflicting-classes`
381
381
 
382
- Detects classes that set the same CSS property. Reports which property conflicts and which class
383
- 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.
384
389
 
385
390
  ```tsx
386
391
  // ❌ Bad
387
392
  <div className="text-red-500 text-blue-500" />
388
- // "text-red-500" and "text-blue-500" affect "color".
389
- // "text-blue-500" takes precedence (appears later).
393
+ // "text-red-500" overrides "text-blue-500" on "color".
390
394
 
391
395
  <div className="mt-2 mt-4" />
392
- // "mt-2" and "mt-4" affect "margin-top".
396
+ // "mt-4" overrides "mt-2" on "margin-top".
393
397
  ```
394
398
 
395
399
  > **Note:** Shorthand vs longhand conflicts (e.g., `p-4` vs `px-2`) are not currently detected. See
@@ -937,14 +941,15 @@ The class parser correctly handles:
937
941
  forms (`p-[2px]`, `bg-(--c)`) are canonicalized dynamically via the worker. Some valid v4 classes
938
942
  that don't appear in `getClassList()` and have no canonical rewrite (e.g. `border-1` is valid as a
939
943
  dynamic numeric value but isn't enumerated) are left untouched.
940
- - **`no-conflicting-classes`**: Uses exact CSS property name matching plus composition heuristics:
941
- CSS-var composition (`shadow` + `ring`), narrowing-override (later class is a strict subset of
942
- earlier — handles `size-4 h-6`, `rounded-t-lg rounded-tl-sm`, `truncate text-clip`), complementary
943
- groups (gradient stops, transition family, transform axes, mask gradient family across
944
- edges/axes/`linear`/`radial`/`conic`), and composition pairs (e.g. `mask-add` + any mask
945
- gradient). Shorthand vs longhand cases where Tailwind emits the shorthand and Tailwind's longhand
946
- has a different CSS property name (e.g., `p-4` vs `px-2`: `padding` vs
947
- `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.
948
953
  - **`no-dark-without-light`**: Groups by utility prefix heuristic. May not perfectly match all
949
954
  multi-part utility prefixes.
950
955
  - **`no-unnecessary-arbitrary-value`**: Only detects equivalences for classes with a single CSS
@@ -959,15 +964,17 @@ point — `@plugin '...'` or `@import '...'` — is recognized automatically by
959
964
  following are exercised by the test suite:
960
965
 
961
966
  - **[`@tailwindcss/typography`](https://github.com/tailwindlabs/tailwindcss-typography)** — `prose`,
962
- `prose-sm/lg/xl`, `not-prose`. `no-conflicting-classes` extracts only root-level CSS properties
963
- 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.
964
970
  - **[`tailwindcss-animate`](https://github.com/jamiebuilds/tailwindcss-animate)** — `animate-in`,
965
971
  `animate-out`, `fade-{in,out}-*`, `zoom-{in,out}-*`, `spin-{in,out}-*`,
966
972
  `slide-{in-from,out-to}-*`, `duration-*`, `delay-*`, `ease-*`, `direction-*`, `fill-mode-*`,
967
973
  `repeat-*`, `running`, `paused`. `animate-in`/`animate-out` initialize all `--tw-enter-*` /
968
974
  `--tw-exit-*` custom properties to `initial`, and modifiers (`fade-in`, `zoom-in`,
969
- `slide-in-from-*`, etc.) each override one of them; this composition is recognized by
970
- `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.
971
978
  - **[`tw-animate-css`](https://github.com/Wombosvideo/tw-animate-css)** — v4-native rewrite of
972
979
  `tailwindcss-animate`. Adds `blur-{in,out}-*`, logical (RTL-aware)
973
980
  `slide-{in-from,out-to}-{start,end}-*`, `play-state-*`, `animation-duration-*`, and the