oxlint-tailwindcss 1.8.0 → 1.10.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 +23 -9
- package/dist/index.cjs +408 -54
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +409 -55
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,8 +18,11 @@ Read the story behind this plugin:
|
|
|
18
18
|
per package. Both fully deterministic.
|
|
19
19
|
- **Coexists with oxfmt and Prettier** — Point all tools at the same CSS and they agree
|
|
20
20
|
byte-for-byte. See the [interop guide](https://oxlint-tailwindcss.pages.dev/interop).
|
|
21
|
-
- **Tailwind CSS v4
|
|
22
|
-
your shadcn variables, your typography plugin.
|
|
21
|
+
- **Tailwind CSS v4.1+** — Designed for v4 from day one. Reads your `@theme { ... }` custom tokens,
|
|
22
|
+
your shadcn variables, your typography plugin. It loads _your_ project's Tailwind engine, resolved
|
|
23
|
+
per entry point, so the linter and your build agree; an engine older than v4.1, a future major, or
|
|
24
|
+
a major-version drift from your build fails loud (opt back in with
|
|
25
|
+
`settings.tailwindcss.allowUntestedEngine`).
|
|
23
26
|
- **Fail loud** — Misconfiguration surfaces as a single `designSystemUnavailable` diagnostic with an
|
|
24
27
|
actionable hint. Never silently skipped rules.
|
|
25
28
|
- **Fast** — Native oxlint plugin with per-entry-point caching and content-hash disk cache for
|
|
@@ -58,6 +61,7 @@ Add the plugin to your `.oxlintrc.json`:
|
|
|
58
61
|
"tailwindcss/no-conflicting-classes": "error",
|
|
59
62
|
"tailwindcss/no-deprecated-classes": "error",
|
|
60
63
|
"tailwindcss/no-unnecessary-whitespace": "error",
|
|
64
|
+
// These two only inspect literal class lists on native elements; cn()/twMerge() fragments and custom-component classNames are skipped (issue #117).
|
|
61
65
|
"tailwindcss/no-dark-without-light": "warn",
|
|
62
66
|
"tailwindcss/no-contradicting-variants": "warn",
|
|
63
67
|
// Style
|
|
@@ -473,6 +477,11 @@ Requires a base (light) utility when using the `dark:` variant on the same eleme
|
|
|
473
477
|
Groups by utility prefix (`bg-`, `text-`, `border-`, etc.) — only checks that a base utility of the
|
|
474
478
|
same type exists.
|
|
475
479
|
|
|
480
|
+
**Scope (issue #117):** only inspects literal class lists on **native host elements** (`<div>`,
|
|
481
|
+
`<input>`, …). Strings passed to `cn`/`twMerge`/`cva` or set on a custom component's `className` are
|
|
482
|
+
override fragments whose light base commonly lives in another module, so they are skipped to avoid
|
|
483
|
+
false positives.
|
|
484
|
+
|
|
476
485
|
**Options:**
|
|
477
486
|
|
|
478
487
|
| Option | Type | Default | Description |
|
|
@@ -504,6 +513,11 @@ Only flags when the exact same utility exists both as base and with a conditiona
|
|
|
504
513
|
that change the selector target (pseudo-elements, child/descendant selectors, arbitrary selectors)
|
|
505
514
|
are not flagged.
|
|
506
515
|
|
|
516
|
+
**Scope (issue #117):** only inspects literal class lists on **native host elements** (`<div>`,
|
|
517
|
+
`<button>`, …). Strings passed to `cn`/`twMerge`/`cva` or set on a custom component's `className`
|
|
518
|
+
are override fragments where the "redundant" variant is often load-bearing (it beats a same-group
|
|
519
|
+
class the component merges in), so they are skipped to avoid false positives.
|
|
520
|
+
|
|
507
521
|
**No options.** **No autofix.**
|
|
508
522
|
|
|
509
523
|
---
|
|
@@ -987,15 +1001,15 @@ the box. If you find one that doesn't, open an issue.
|
|
|
987
1001
|
## Requirements
|
|
988
1002
|
|
|
989
1003
|
- Node.js >= 20
|
|
990
|
-
- Tailwind CSS v4
|
|
1004
|
+
- Tailwind CSS v4.1 or newer (4.0.x is not supported — it predates a design-system API the plugin
|
|
1005
|
+
needs, and is reported with a clear diagnostic)
|
|
991
1006
|
- oxlint >= 1.43.0
|
|
992
1007
|
|
|
993
|
-
> **oxlint 1.77.0
|
|
994
|
-
>
|
|
995
|
-
>
|
|
996
|
-
>
|
|
997
|
-
> (
|
|
998
|
-
> unaffected, so CI is fine; if you use the editor extension, pin `oxlint@1.76.0` for now.
|
|
1008
|
+
> **Avoid oxlint 1.77.0 with the editor extension.** 1.77.0 panics the oxlint **language server** on
|
|
1009
|
+
> any diagnostic from any JS plugin (`disable_fix.rs:52`, then SIGABRT and a restart loop). It's an
|
|
1010
|
+
> oxlint bug, not a plugin one, and the CLI is unaffected (CI is fine). It's **fixed in oxlint
|
|
1011
|
+
> 1.78.0** ([oxc#25280](https://github.com/oxc-project/oxc/pull/25280)) — upgrade to `oxlint@1.78.0`
|
|
1012
|
+
> or newer (or stay on `1.76.0`) if you use the editor extension.
|
|
999
1013
|
|
|
1000
1014
|
## License
|
|
1001
1015
|
|