Skip to content

Lint rule reference

Find a lint rule by the kind of mistake or policy that it reports.

Lint rules report mistakes and project policies in your styles. The CLI and the editor run them. Checks in the editor and CI explains where the rules run, and Configuration covers presets, severities, and suppression comments.

The Default column shows the severity in the recommended preset, which a project uses when it has no lint setting. Each rule page shows its severity in every preset.

Misspelled or invalid utilities

A utility or variant that these rules report produces no CSS.

Rule Reports Default
invalid-marker-use A marker class such as group with a variant or ! warn
invalid-utility A known utility written in a form that it does not accept deny
invalid-variant A known variant with an invalid value, such as min-[foo]: deny
unknown-utility A utility or theme value that your stylesheet does not define deny
unknown-variant A variant that your stylesheet does not define deny

Invalid arguments to Stillwind APIs

An argument that these rules report adds no CSS, and a condition that they report never matches.

Rule Reports Default
invalid-animation-option A utility that is not an animation option, such as p-4 deny
invalid-css-input A style.css() argument that is not a static utility deny
invalid-cva-config An unknown or malformed field in a style.cva() configuration deny
invalid-cva-input && or a ternary inside a style.cva() value deny
invalid-keyframes-definition A frame key that is not a keyframe position, such as middle deny
invalid-keyframes-use An animation applied with an argument that is not an options string deny
invalid-keyframes-variant A selector or container variant around a keyframes definition deny
invalid-media-query A condition in style.media() that is not a media query, such as hover deny
invalid-ref-input A style.ref() label or ref method argument that is not a literal deny
invalid-rule-group-input A class field or ref inside a variant key of style() deny
invalid-runtime-condition A runtime CSS condition that Stillwind cannot compile deny
invalid-style-composition Inline styles or custom properties in a base style, which do not carry over deny
invalid-style-input A style() argument that it cannot compile, such as a number deny
invalid-view-transition-definition An unknown field in a style.viewTransition() definition deny
invalid-view-transition-use Extra or invalid arguments to .for() deny
invalid-view-transition-variant A state or container variant in a view transition definition deny
missing-document-target A style.css() utility without a selector deny
runtime-condition-requires-css-if A runtime CSS condition that needs useCssIf deny

Arguments and imports

Rule Reports Default
mismatched-framework-import An import from the entrypoint of another framework warn
mutating-macro-argument A state update inside a style() argument deny
suspending-macro-argument await, yield, or import() inside a style() argument deny

Conflicting or duplicated styles

Rule Reports Default
ambiguous-style-base-order Two base styles in one call that set the same property warn
conflicting-provider-properties A container or anchor property that a ref method and a utility both set warn
conflicting-utilities Utilities that set the same property, such as p-2 p-4 warn
duplicate-utility The same utility twice under the same conditions warn
interfering-imported-style-base An imported base style that sets the same property as another style warn
unverified-style-base A base style whose origin the CLI cannot determine from its type warn

Styles that do not apply as written

Rule Reports Default
clamped-value A value outside the range that the browser uses, such as opacity above 1 warn
document-scoped-selector A selector that styles the whole document instead of the element deny
duplicate-view-transition-name Two .for() calls in one style() call warn
incompatible-property-value A value that the browser rejects for the property deny
ineffective-anchor-scope An empty or repeated ref list in an anchor scope warn
missing-ref-attachment asContainer() or asAnchor() in a call that does not attach the ref warn
missing-view-transition-name A view transition applied without .for() warn
repeated-nesting-selector A selector that repeats & to relate two elements warn
split-view-transition-class View transitions split across separate style() calls warn
unsatisfiable-variants Variants that can never match together, such as portrait:landscape: warn

Stylesheet definitions

Rule Reports Default
bypassed-undefinition A definition that bypasses an undefinition in another context warn
duplicate-definition A utility or variant definition that replaces an earlier one warn
ignored-definition-condition A media rule around a definition, which the compiler ignores deny
ignored-tailwind-feature Tailwind-only directives such as @config, which have no effect warn
implicit-nesting-selector A custom variant selector without &, which selects descendants warn
incompatible-theme-value A theme value of the wrong type, such as a length for a color deny
invalid-css-directive A malformed or unsupported Stillwind directive deny
invalid-css-import A stylesheet import that cannot be resolved deny
invalid-theme-reference A reference to a theme token that is not defined deny

Project policies

These rules enforce choices of your project. No preset enables them.

Rule Reports Default
no-arbitrary-breakpoints Viewport widths written as values, such as min-[713px]: off
no-arbitrary-colors Colors written as values, such as bg-[#123456] off
no-arbitrary-spacing Spacing written as values, such as p-[13px] off
no-class-property The class field, which adds classes without generated CSS off
no-important The ! modifier off
no-restricted-declarations Utilities that produce the CSS declarations that you list off
no-restricted-length-units Length units that you forbid for the properties that you list off
no-restricted-theme-tokens Utilities that use the theme tokens that you list off
no-restricted-utilities The utilities that you list off

Preferred spelling

These rules report code that works but has a clearer form. The stylistic preset enables the rules that are off by default.

Rule Reports Default
prefer-canonical-utilities A utility with a shorter equivalent, such as px-[16px] for px-4 warn
prefer-direct-styling A selector that styles another element, such as [&_button]: off
prefer-logical-properties A physical property with a logical form, such as ml-4 off
prefer-sorted-utilities Utilities that are not in sorted order off
prefer-typed-relationships group-* and peer-* variants that a ref can replace off
prefer-typed-variables A custom property without a type in a utility that accepts several types off
prefer-variant-directive A media rule in your CSS that a named variant can replace off
redundant-variant A variant that adds no condition, such as hover:hover: warn

Suppression comments

Rule Reports Default
invalid-lint-suppression A malformed comment or an unknown rule name warn
unused-lint-suppression A comment that suppresses no finding off