Skip to content

astro

Astro components: the recommended and accessibility rules for frontmatter, markup, and scripts, and a type check of each component. It requires javascript. Guide: Astro.

A scope has a file extension .astro, or a dependency on astro.

Runs astro check over the scope: the type errors and warnings of every Astro component.

Runs at the push stage, once per scope, and loads your code.

tsc cannot parse a component file, so a type error inside one ships unless astro check catches it.

Fix the first error astro check prints; later errors often come from the same mistake.

A component whose frontmatter holds const count: number = 'three'; reports ts(2322). Give the value the declared type, such as const count: number = 3;.

gspot ignore astro/astro-check --paths "<path>" --reason "<why>"
gspot ignore astro/astro-check --rule <rule> --reason "<why>"
Lint rules Files Why
import-x/no-default-export **/*.astro Astro compiles each component to a default export.
Setting Value
javascript.import_extension "extensionless"
Rule file Installed when
.gspot/rules/ASTRO.md Always
Tool Version
eslint-plugin-astro 3.2.1
eslint-plugin-jsx-a11y-x 0.2.0
astro-check 0.9.10
@emnapi/runtime 1.11.3
prettier-plugin-astro 1.1.1