# Validation Checklist Complete checklist for validating an Astro installation/upgrade. Run these checks in the project root. --- ## 1. Build Validation ```bash # Full production build — must exit 0 with no errors npx astro build # Type checking (requires @astrojs/check) npx astro check # Verify no unclosed tags (Rust compiler is strict about this) find src -name "*.astro" -exec grep -Pn '<(img|br|hr|input|meta|link|source|area|base|col|embed|param|track|wbr)[^/]*[^/]>' {} + # Check for HTML nesting issues (div/section/article inside p) grep -rPn '
]*>[\s\S]*?<(div|section|article|ul|ol|table|blockquote|h[1-6])' src/**/*.astro ``` **Expected:** All commands pass with no errors or matches. --- ## 2. Breaking Pattern Detection ### Unclosed HTML tags ```bash # Find self-closing tags that are NOT void elements (common breakage) grep -rPn '<(div|span|p|a|section|main|footer|header|nav|ul|li)\s[^>]*/>' src/ --include="*.astro" ``` ### Block elements inside `
` ```bash grep -rPn '
]*>[\s\S]*?<(div|section|article|ul|ol|dl|table|blockquote|pre|h[1-6]|form|fieldset|hr)' src/ --include="*.astro"
```
### Whitespace-dependent inline layouts
```bash
# Look for adjacent inline elements that rely on whitespace rendering
grep -rPn '(span|a|strong|em|code)>\s*<(span|a|strong|em|code)' src/ --include="*.astro"
```
### src/fetch.ts conflict
```bash
# Astro reserves src/fetch.ts — check if it exists
find src -maxdepth 1 -name "fetch.ts" -o -name "fetch.js"
```
### @astrojs/db usage (removed in Astro 5+)
```bash
grep -rn "@astrojs/db" package.json src/ --include="*.{ts,js,astro}"
```
### Deprecated transition imports
```bash
# TRANSITION_* named exports removed
grep -rPn 'TRANSITION_[A-Z_]+' src/ --include="*.{ts,js,astro}"
# isTransition*() helpers removed
grep -rPn 'isTransition\w+\(' src/ --include="*.{ts,js,astro}"
```
### getContainerRenderer() from package root
```bash
# Must now import from /container subpath
grep -rn "getContainerRenderer" src/ --include="*.{ts,js}" | grep -v "/container"
```
### Experimental flags that should be removed
```bash
# Check astro.config for experimental flags that graduated to stable
grep -A 20 'experimental:' astro.config.{mjs,ts,js} 2>/dev/null | grep -P '(contentLayer|serverIslands|actions|env|fonts|responsiveImages|svg)'
```
---
## 3. Deprecated Pattern Detection
| Pattern | grep command | Fix |
|---------|-------------|-----|
| `Astro.glob()` | `grep -rn "Astro.glob" src/ --include="*.astro"` | Replace with `import.meta.glob()` or Content Collections |
| `Astro.fetchContent()` | `grep -rn "Astro.fetchContent" src/ --include="*.astro"` | Replace with Content Collections |
| `getStaticPaths` without `paginate` import | `grep -rn "getStaticPaths" src/ --include="*.astro"` | Verify using new pagination API |
| Legacy content collections (`src/content/config.ts` with `defineCollection` using `schema` only) | `grep -rn "defineCollection" src/content/config.ts` | Migrate to `type: 'content_layer'` or new loader API |
| `@astrojs/image` | `grep -rn "@astrojs/image" package.json` | Use built-in `astro:assets` |
| `integrations: [image()]` | `grep -rn "image()" astro.config.*` | Remove — use built-in `