Skip to content

Rules

The 23 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

Style and consistency

Design-system discipline

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{}
enforce-sort-order{ mode: 'default' }
no-conflicting-classes{ reportRedundant: true }
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{} (DS-derived order when available)Real variant order, and what each variant's selector does
enforce-logical{ allowlist: [], direction: 'both' }Confirms the suggested class exists
enforce-physical{ allowlist: [], direction: 'both' }Confirms the suggested class exists
enforce-shorthand{}Verifies each merge against the emitted CSS
no-contradicting-variants{}What each variant's selector does
no-dark-without-light{ variants: ['dark'] }Groups the base by declared CSS property, not just by prefix
no-deprecated-classes{}Derives the rename list instead of using the built-in table

DS-independent rules

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

Released under the MIT License.