Best Practiceswarn by default
recommended preset
astro-doctor/no-legacy-astro-7-experimental-flagsno-legacy-astro-7-experimental-flags
Migrate experimental configuration fields removed or stabilized in Astro 7.
Why
Astro 7 removed the experimental wrappers for advanced routing, caching, logging, route rules, queued rendering, and the Rust compiler. Leaving these fields under experimental can make an upgrade fail validation or silently miss the intended configuration.
Examples
Incorrect
Astro 6 experimental configuration
export default defineConfig({
experimental: {
advancedRouting: true,
cache: { provider: memoryCache() },
routeRules: {},
rustCompiler: true,
},
})Correct
Astro 7 stable configuration
export default defineConfig({
cache: { provider: memoryCache() },
routeRules: {},
})Configuration
Project audits are configured in doctor.config.ts:
export default {
rules: {
'astro-doctor/no-legacy-astro-7-experimental-flags': 'error', // or 'warn' or 'off'
},
}All rules
astro-doctor/no-client-load-overuseastro-doctor/use-astro-imageastro-doctor/require-image-dimensionsastro-doctor/no-missing-altastro-doctor/no-set-htmlastro-doctor/no-public-secret-envastro-doctor/prefer-class-listastro-doctor/no-blocking-scriptastro-doctor/no-unprocessed-script-surprisesastro-doctor/no-missing-langastro-doctor/require-island-fallbackastro-doctor/no-process-envastro-doctor/prefer-content-collectionsastro-doctor/no-disabled-origin-checkastro-doctor/no-insecure-session-cookieastro-doctor/no-open-allowed-domainsastro-doctor/no-legacy-astro-7-experimental-flags(this page)astro-doctor/prefer-env-schemaastro-doctor/prefer-pnpmastro-doctor/require-action-input-schemaastro-doctor/require-client-router-script-lifecycleastro-doctor/require-content-configastro-doctor/require-fetch-default-export