Rules
astro-doctor provides 13 proprietary ESLint rules for .astro files,9 project-wide audits, and up to 54 officialeslint-plugin-astro rules. The all preset exposes 63 unique ESLint checks after overlap deduplication, plus project audits.
Proprietary rules
| Rule | Category | Default | Fixable |
|---|---|---|---|
astro-doctor/no-client-load-overuse | Performance | warn | — |
astro-doctor/use-astro-image | Performance | warn | — |
astro-doctor/require-image-dimensions | Performance | warn | — |
astro-doctor/no-missing-alt | Accessibility | error | — |
astro-doctor/no-set-html | Security | warn | — |
astro-doctor/no-public-secret-env | Security | warn | — |
astro-doctor/prefer-class-list | Best Practices | warn | — |
astro-doctor/no-blocking-script | Performance | warn | — |
astro-doctor/no-unprocessed-script-surprises | Performance | warn | — |
astro-doctor/no-missing-lang | Accessibility | error | — |
astro-doctor/require-island-fallback | Accessibility | warn | — |
astro-doctor/no-process-env | Best Practices | warn | — |
astro-doctor/prefer-content-collections | Best Practices | warn | — |
Project audits
The CLI also evaluates configuration and relationships across files that an isolated ESLint rule cannot see.
| Check | Category | Preset |
|---|---|---|
astro-doctor/no-disabled-origin-check | Security | recommended |
astro-doctor/no-insecure-session-cookie | Security | recommended |
astro-doctor/no-open-allowed-domains | Security | recommended |
astro-doctor/prefer-env-schema | Best Practices | recommended |
astro-doctor/prefer-pnpm | Best Practices | opt-in |
astro-doctor/require-action-input-schema | Security | recommended |
astro-doctor/require-client-router-script-lifecycle | Best Practices | strict |
astro-doctor/require-content-config | Best Practices | recommended |
astro-doctor/no-public-secret-env | Security | recommended |
Rule categories
Performance
Rules that help you ship faster pages. Covers hydration strategies (no-client-load-overuse), image optimization (use-astro-image), image dimensions (require-image-dimensions), render-blocking scripts (no-blocking-script), and accidental script processing opt-outs (no-unprocessed-script-surprises).
Accessibility
Rules that ensure your pages are usable by everyone, including screen-reader users. Covers missing alt text (no-missing-alt) and missing language declaration (no-missing-lang), plus fallback content for islands (require-island-fallback).
Security
Rules that prevent common vulnerabilities. Covers unescaped HTML injection (no-set-html) and public environment variables that look like secrets (no-public-secret-env).
Best Practices
Rules that encourage idiomatic Astro patterns: conditional class composition (prefer-class-list), environment variable access (no-process-env), and content management (prefer-content-collections).
Customizing rules
Override any rule severity in your eslint.config.js:
import astroDoctorPlugin from '@santi020k/eslint-plugin-astro-doctor'
export default [
astroDoctorPlugin.configs.recommended,
{
rules: {
// Upgrade to error
'astro-doctor/no-client-load-overuse': 'error',
// Disable a rule
'astro-doctor/prefer-class-list': 'off',
},
},
]Or use a doctor.config.* file for CLI-only overrides.