Skip to contentView the source on GitHub

no-legacy-astro-7-experimental-flags

Migrate experimental configuration fields removed or stabilized in Astro 7.

Best Practiceswarning by default Project auditrecommended audit

astro-doctor/no-legacy-astro-7-experimental-flags

Why it matters

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.

See the difference

Incorrect

Astro 6 experimental configuration

typescriptIncorrect example
export default defineConfig({
  experimental: {
    advancedRouting: true,
    cache: { provider: memoryCache() },
    routeRules: {},
    rustCompiler: true,
  },
})

Correct

Astro 7 stable configuration

typescriptCorrect example
export default defineConfig({
  cache: { provider: memoryCache() },
  routeRules: {},
})

Configure this check

Project audits are configured in doctor.config.ts:

typescriptdoctor.config.ts
export default {
  rules: {
    'astro-doctor/no-legacy-astro-7-experimental-flags': 'error',
  },
}

Use 'error', 'warn', or 'off'. The configuration guide covers presets and per-file overrides.

Keep exploring best practices

Browse every rule and project audit