oxlint-tailwindcss 1.10.1 → 1.11.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
@@ -34,8 +34,8 @@ Read the story behind this plugin:
34
34
  possible.
35
35
  - **Variable detection** — Lints variables matching `/^classNames?$/`, `/^classes$/`, `/^styles?$/`
36
36
  (e.g. `className`, `classNames`, `classes`, `styles`) automatically.
37
- - **Customizable** — Extend class detection with custom attributes, callees, tags, and variable
38
- patterns.
37
+ - **Customizable** — Extend class detection with custom attributes, attribute patterns (regex, for
38
+ `*ClassName` props), callees, tags, and variable patterns.
39
39
  - **Component class support** — Recognizes `@layer components { .btn {} }` in your CSS.
40
40
 
41
41
  Full documentation: **https://oxlint-tailwindcss.pages.dev** (English) ·
@@ -165,6 +165,18 @@ For slow environments (large monorepos, CI), you can increase the design system
165
165
  }
166
166
  ```
167
167
 
168
+ This `timeout` governs the **precompute loader** only. The sort/canonicalize/declaration worker
169
+ services used while linting have a separate **30 s per-request** timeout. If a slow-but-functional
170
+ machine or CI runner reports `worker request timed out after 30000ms` on valid class lists, raise it
171
+ with the `OXLINT_TAILWINDCSS_WORKER_REQUEST_TIMEOUT` environment variable (milliseconds):
172
+
173
+ ```bash
174
+ OXLINT_TAILWINDCSS_WORKER_REQUEST_TIMEOUT=60000 oxlint
175
+ ```
176
+
177
+ A timeout no longer costs O(files): after a few consecutive timeouts for one entry point the rest of
178
+ the run fails fast, and the state self-heals once the machine recovers.
179
+
168
180
  ### Root font size
169
181
 
170
182
  The `enforce-canonical` rule converts px-based arbitrary values to named classes (e.g. `p-[2px]` →
@@ -230,8 +242,11 @@ entries are appended to the built-in defaults:
230
242
  "jsPlugins": ["oxlint-tailwindcss"],
231
243
  "settings": {
232
244
  "tailwindcss": {
233
- // Additional JSX attribute names to scan
245
+ // Additional JSX attribute names to scan (exact match)
234
246
  "attributes": ["xyzClassName", "classNames", "overlayClassName"],
247
+ // Regex patterns for JSX attribute names — catches *ClassName conventions
248
+ // (React Native / Uniwind) without listing every prop
249
+ "attributePatterns": ["ClassName$"],
235
250
  // Additional function names to scan
236
251
  "callees": ["myHelper"],
237
252
  // Additional tagged template tags to scan
@@ -250,6 +265,12 @@ entries are appended to the built-in defaults:
250
265
  This applies to all 24 rules at once. For example, adding `"classNames"` to `attributes` makes every
251
266
  rule lint `<Input classNames={{ root: "..." }} />`.
252
267
 
268
+ > **`attributePatterns` vs `variablePatterns`** — both match by regex, but on different things.
269
+ > `attributePatterns` matches **JSX attribute names** (`contentContainerClassName`,
270
+ > `tintColorClassName`, …); `variablePatterns` matches **variable declaration names only**
271
+ > (`const fooClassName = "..."`), never JSX attributes — despite its default `/^classNames?$/`
272
+ > looking like the `className` attribute.
273
+
253
274
  To **remove** specific items from the built-in defaults, use `exclude`:
254
275
 
255
276
  ```jsonc