Skip to content

unverified-style-base

Reports a base style whose source the CLI cannot find from its type.

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

globals.d.tsts
declare module "virtual:styles" {
  import { style } from "stillwind/react";

  export const base: ReturnType<typeof style>;
}
styles.tsts
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 CSS

Fixed

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

PresetSeverity
recommendedwarn
strictdeny
stylisticoff

Configure lint to change the severity or options.

The CLI and the editor report this rule only when they analyze the whole project.