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 +29 -21
- package/dist/index.cjs +1472 -362
- package/dist/index.d.cts +121 -122
- package/dist/index.d.mts +121 -122
- package/dist/index.mjs +1473 -363
- package/package.json +9 -10
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`, `
|
|
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`
|
|
211
|
-
|
|
212
|
-
|
|
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
|
|
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"
|
|
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-
|
|
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`**:
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
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`. `
|
|
962
|
-
|
|
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
|
|
969
|
-
`no
|
|
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
|