Skip to content

Rules ​

The 27 rules in oxlint-tailwindcss, grouped by what they enforce. Click into any rule for examples and option reference.

Correctness ​

These rules catch problems that would generate invalid or unexpected CSS.

Modernization ​

Consistency ​

Design-system guardrails ​

Per-rule pages ​

Each rule's page covers:

  • What it does, in one paragraph.
  • Options with their default values and a description per option.
  • Correct / incorrect examples.
  • When to disable it — the use cases where this rule is the wrong fit.
  • For DS-dependent rules: whether entryPoint is required (always yes in v1) and what happens when it's missing.

Defaults reference ​

A quick lookup table for what each rule does when you turn it on without overriding meta.defaultOptions.

DS-dependent rules ​

These rules require settings.tailwindcss.entryPoint to be set; they emit a fatal designSystemUnavailable diagnostic when it isn't.

RuleDefault options
enforce-canonical{ reportNonEquivalent: false }
enforce-sort-order{ mode: 'default' }
no-borrowed-component-styles{ components: [] }
no-conflicting-classes{ reportRedundant: true }
no-default-palette{ allow: [] }
no-unknown-classes{ allowlist: [], ignorePrefixes: [] }
no-unnecessary-arbitrary-value{}
prefer-scale-token{}
prefer-theme-tokens{}

DS-optional rules ​

These work with nothing configured — their fallback is deterministic on its own — and get more accurate when an entryPoint is available. None of them can emit designSystemUnavailable. Each also accepts a rule-level entryPoint that overrides the shared setting.

RuleDefault optionsWhat the design system adds
consistent-variant-order{} (same order with or without a DS)What the project's own variants are: pseudo-element, barrier or breakpoint
enforce-consistent-line-wrapping{ printWidth: 80, group: 'newLine', wrapStrings: 'never' }The project prefix, so wrapLines: 'all' grouping treats it as transparent
enforce-logical{ allowlist: [], direction: 'both', sizing: false }Confirms the suggested class exists and that your Tailwind has the 4.2 utilities (block axis, sizes, inset-s); without a DS the block axis and sizes are only suggested
enforce-physical{ allowlist: [], direction: 'both', sizing: false }Confirms the suggested class exists
enforce-shorthand{}Verifies each merge against the emitted CSS
no-arbitrary-value{ allow: [], allowVariables: 'none' }With allowVariables: 'runtime', which CSS variables your stylesheet defines
no-contradicting-variants{}What each variant's selector does
no-dark-without-light{ variants: ['dark'] }Tells colours from the rest, and groups the base by declared CSS property
no-deprecated-classes{}Derives the rename list instead of using the built-in table
no-dynamic-classes{}Your project's own utilities and variants count as Tailwind's
no-hardcoded-colors{ allow: [] }Names your theme's colors in the message

DS-independent rules ​

RuleDefault options
enforce-consistent-important-position{ position: 'suffix' }
enforce-consistent-variable-syntax{ syntax: 'shorthand' }
enforce-negative-arbitrary-values(no options)
max-class-count{ max: 20 }
no-duplicate-classes(no options)
no-restricted-classes{ classes: [], patterns: [] }
no-unnecessary-whitespace(no options)

Released under the MIT License.