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.
Selected when
Section titled “Selected when”A scope has a file extension .astro, or a dependency on astro.
Checks
Section titled “Checks”astro-check
Section titled “astro-check”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.
What to do
Section titled “What to do”Fix the first error astro check prints; later errors often come from the same mistake.
Example
Section titled “Example”A component whose frontmatter holds const count: number = 'three'; reports ts(2322). Give the value the declared type, such as const count: number = 3;.
Turn it off
Section titled “Turn it off”gspot ignore astro/astro-check --paths "<path>" --reason "<why>"gspot ignore astro/astro-check --rule <rule> --reason "<why>"Lint rules turned off
Section titled “Lint rules turned off”| Lint rules | Files | Why |
|---|---|---|
import-x/no-default-export |
**/*.astro |
Astro compiles each component to a default export. |
Defaults set for other configurations
Section titled “Defaults set for other configurations”| Setting | Value |
|---|---|
javascript.import_extension |
"extensionless" |
Rules for coding agents
Section titled “Rules for coding agents”| Rule file | Installed when |
|---|---|
.gspot/rules/ASTRO.md |
Always |
Tools and versions
Section titled “Tools and versions”| 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 |