Astro

Astro-specific configuration for Ultracite.

The Astro configuration has Astro-specific linting rule adjustments to handle the unique structure of Astro components, particularly around frontmatter scripts and component syntax.

Installation

Add the Astro configuration to your biome.jsonc:

biome.jsonc
{
  "extends": ["ultracite/core", "ultracite/astro"]
}

Overview

This configuration adjusts rules for Astro development:

  • Unused Variables/Imports: Allows unused variables and imports in Astro files due to frontmatter constraints where variables may be used only in the template
  • Variable Declarations: Relaxes const enforcement since Astro frontmatter may require reassignable variables
  • Import Types: Disables explicit import type requirements for better compatibility
  • React-Specific Props: Flags React-specific props like className since Astro uses standard HTML attributes

Astro-Specific Rules

Correctness

RuleSettingDescription
noUnusedVariablesoffAllow unused variables in Astro files. Variables declared in frontmatter may only be used in the template section.
noUnusedImportsoffAllow unused imports in Astro files. Imports in frontmatter may only be used in the template section.

Style

RuleSettingDescription
useConstoffAllow let and var declarations. Astro component frontmatter may require reassignable variables.
useImportTypeoffDisable explicit import type requirements for better compatibility with Astro's build system.

Suspicious

RuleSettingDescription
noReactSpecificPropserrorDisallow React-specific props like className and htmlFor in Astro. Use class and for instead.

How is this guide?