This rule reports a base style whose type does not show which style() call
created it, such as a value declared as ReturnType<typeof style>. The compiler
cannot find the CSS of the base, so it cannot order the later utilities after it.
Project files
declare module "virtual:styles" {
import { style } from "stillwind/react";
export const base: ReturnType<typeof style>;
}import { style } from "stillwind/react";
export const base = style("rounded-md");Reported
import { base } from "virtual:styles";
export const props = style(base, "p-4");unverified-style-base: the style base cannot be identified, so its CSS may follow this call's CSSFixed
import { base } from "./styles";
export const props = style(base, "p-4");How to fix
- Import the base from the source module that calls
style(), as in the example. - Keep the type that TypeScript infers when you export a style. A type annotation
such as
ReturnType<typeof style>hides the source.
Rule settings
| Preset | Severity |
|---|---|
recommended | warn |
strict | deny |
stylistic | off |
Configure lint to change the severity or options.
The CLI and the editor report this rule only when they analyze the whole project.