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:
{
"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
constenforcement 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
classNamesince Astro uses standard HTML attributes
Astro-Specific Rules
Correctness
| Rule | Setting | Description |
|---|---|---|
noUnusedVariables | off | Allow unused variables in Astro files. Variables declared in frontmatter may only be used in the template section. |
noUnusedImports | off | Allow unused imports in Astro files. Imports in frontmatter may only be used in the template section. |
Style
| Rule | Setting | Description |
|---|---|---|
useConst | off | Allow let and var declarations. Astro component frontmatter may require reassignable variables. |
useImportType | off | Disable explicit import type requirements for better compatibility with Astro's build system. |
Suspicious
| Rule | Setting | Description |
|---|---|---|
noReactSpecificProps | error | Disallow React-specific props like className and htmlFor in Astro. Use class and for instead. |
How is this guide?