Quick Start

Get up and running in about 5 minutes.

Step 1 — Install

pnpm add -D @santi020k/astro-doctor @santi020k/eslint-plugin-astro-doctor
npm install --save-dev @santi020k/astro-doctor @santi020k/eslint-plugin-astro-doctor
yarn add -D @santi020k/astro-doctor @santi020k/eslint-plugin-astro-doctor
bun add -D @santi020k/astro-doctor @santi020k/eslint-plugin-astro-doctor

Step 2 — Configure ESLint

Add the plugin to your existing eslint.config.js (flat config):

// eslint.config.js
import astroDoctorPlugin from '@santi020k/eslint-plugin-astro-doctor'

export default [
  // your existing config...
  astroDoctorPlugin.configs.recommended,
]
       
  

Step 3 — Run a scan

pnpm dlx @santi020k/astro-doctor@latest
npx @santi020k/astro-doctor@latest
yarn dlx @santi020k/astro-doctor@latest
bunx @santi020k/astro-doctor@latest

You'll see output like:

Scanning /my-project...

  ✗  error  src/pages/blog.astro:12:5
     no-missing-alt — img element is missing a non-empty alt attribute

  ⚠  warn   src/components/Counter.astro:3:1
     no-client-load-overuse — prefer client:idle or client:visible over client:load

14 files scanned · 1 error · 1 warning

Astro Doctor Score: 85/100 (B) 🟡
       
  

Step 4 — Add to package.json

{
  "scripts": {
    "astro:check": "astro-doctor",
    "astro:check:json": "astro-doctor --json report.json"
  }
}
       
  

Step 5 — Add to CI (optional)

Drop this into .github/workflows/astro-doctor.yml:

name: Astro Doctor
on:
  pull_request:
    paths:
      - '**/*.astro'
      - 'astro.config.*'
      - 'package.json'
      - '.env.example'
      - 'src/content/**'

jobs:
  scan:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: santi020k/astro-doctor@v1
        with:
          diff-only: true
          comment: true
          fail-on: error
       
  
Next steps: Read the configuration guide to tune presets, rules, ignore paths, and fail thresholds.