oxlint-tailwindcss 0.1.4 → 0.1.6

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
@@ -1,6 +1,6 @@
1
1
  # oxlint-tailwindcss
2
2
 
3
- 21 Tailwind CSS linting rules for [oxlint](https://oxc.rs/docs/guide/usage/linter). Built for Tailwind CSS v4 with zero-config auto-detection, typo suggestions, and autofixes.
3
+ 22 Tailwind CSS linting rules for [oxlint](https://oxc.rs/docs/guide/usage/linter). Built for Tailwind CSS v4 with zero-config auto-detection, typo suggestions, and autofixes.
4
4
 
5
5
  ## Highlights
6
6
 
@@ -10,7 +10,7 @@
10
10
  - **Typo suggestions** — `itms-center` → "Did you mean `items-center`?"
11
11
  - **Conflict detection** — Shows exactly which CSS properties conflict and which class wins.
12
12
  - **Lightweight** — Only 2 runtime dependencies: `@tailwindcss/node` and `tailwindcss`.
13
- - **21 rules** — Correctness, style, complexity, and restriction rules with autofixes where possible.
13
+ - **22 rules** — Correctness, style, complexity, and restriction rules with autofixes where possible.
14
14
  - **Variable detection** — Lints variables named `className`, `classes`, `style` automatically.
15
15
  - **Component class support** — Recognizes `@layer components { .btn {} }` in your CSS.
16
16
 
@@ -41,13 +41,14 @@ Add the plugin to your `.oxlintrc.json`:
41
41
  "tailwindcss/enforce-sort-order": "warn",
42
42
  "tailwindcss/enforce-shorthand": "warn",
43
43
  "tailwindcss/enforce-logical": "off",
44
+ "tailwindcss/enforce-physical": "off",
44
45
  "tailwindcss/enforce-consistent-important-position": "warn",
45
46
  "tailwindcss/enforce-negative-arbitrary-values": "warn",
46
47
  "tailwindcss/enforce-consistent-variable-syntax": "warn",
47
48
  "tailwindcss/consistent-variant-order": "warn",
48
49
  // Complexity
49
- "tailwindcss/max-class-count": "warn",
50
- "tailwindcss/enforce-consistent-line-wrapping": "warn",
50
+ "tailwindcss/max-class-count": "off",
51
+ "tailwindcss/enforce-consistent-line-wrapping": "off",
51
52
  // Restrictions
52
53
  "tailwindcss/no-restricted-classes": "off",
53
54
  "tailwindcss/no-arbitrary-value": "off",
@@ -97,7 +98,10 @@ You can also override per rule if needed:
97
98
  ```jsonc
98
99
  {
99
100
  "rules": {
100
- "tailwindcss/no-unknown-classes": ["error", { "entryPoint": "src/app.css" }],
101
+ "tailwindcss/no-unknown-classes": [
102
+ "error",
103
+ { "entryPoint": "src/app.css" },
104
+ ],
101
105
  },
102
106
  }
103
107
  ```
@@ -334,7 +338,7 @@ Suggests the canonical form of a class when a shorter equivalent exists. Only kn
334
338
 
335
339
  #### `enforce-sort-order`
336
340
 
337
- Sorts classes according to Tailwind's official class order.
341
+ Sorts classes according to Tailwind's official class order — identical to [oxfmt](https://oxc.rs/docs/guide/usage/formatter) and [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss). Uses `ds.getClassOrder()` from the Tailwind CSS engine for exact results.
338
342
 
339
343
  ```tsx
340
344
  // ❌ Bad
@@ -404,6 +408,24 @@ Also converts `border-l/r`, `rounded-l/r/tl/tr/bl/br`, and `scroll-ml/mr/pl/pr`
404
408
 
405
409
  ---
406
410
 
411
+ #### `enforce-physical`
412
+
413
+ The inverse of `enforce-logical`. Converts logical properties back to physical ones for consistency in LTR-only projects.
414
+
415
+ ```tsx
416
+ // ❌ Bad → ✅ Fixed
417
+ "ms-4" → "ml-4"
418
+ "me-4" → "mr-4"
419
+ "ps-4" → "pl-4"
420
+ "pe-4" → "pr-4"
421
+ "start-0" → "left-0"
422
+ "end-0" → "right-0"
423
+ ```
424
+
425
+ **Autofix:** Replaces with physical equivalent.
426
+
427
+ ---
428
+
407
429
  #### `enforce-consistent-important-position`
408
430
 
409
431
  Enforces a consistent position for the `!` (important) modifier — either prefix or suffix.
@@ -659,7 +681,6 @@ The class parser correctly handles:
659
681
 
660
682
  - **`enforce-canonical`**: Only classes in Tailwind's class list can be canonicalized. Some valid classes (e.g., `grow-1`, `border-1`) are not in the list and won't be converted. Arbitrary values are also not canonicalized.
661
683
  - **`no-conflicting-classes`**: Uses exact CSS property name matching. Shorthand vs longhand conflicts (e.g., `p-4` vs `px-2` where `padding` conflicts with `padding-left`) are not detected.
662
- - **`enforce-sort-order`**: Variant-prefixed classes use the base utility's sort order as a fallback, which may not be 100% accurate for complex variant combinations.
663
684
  - **`no-dark-without-light`**: Groups by utility prefix heuristic. May not perfectly match all multi-part utility prefixes.
664
685
  - **`no-unnecessary-arbitrary-value`**: Only detects equivalences for classes with a single CSS property. Multi-property utilities may have arbitrary forms that aren't detected.
665
686
  - **Component classes**: Only first-level `@import` relative paths are followed. Deeply nested imports or absolute paths are not resolved.