Accessibility warn by default
astro-doctor/require-island-fallback require-island-fallback
Require fallback content for client-only and deferred server islands.
Why
client:only skips server rendering, and server:defer renders later on demand. Fallback content gives users immediate context instead of leaving an empty region while the island loads.
Examples
✗ Incorrect
Island with no fallback
---
import Chart from '../components/Chart.tsx'
---
<Chart client:only="react" /> ✓ Correct
Island with fallback content
---
import Chart from '../components/Chart.tsx'
---
<Chart client:only="react">
<div slot="fallback">Loading chart...</div>
</Chart> Configuration
Override the default severity in your ESLint config:
// eslint.config.js
import astroDoctorPlugin from '@santi020k/eslint-plugin-astro-doctor'
export default [
astroDoctorPlugin.configs.recommended,
{
rules: {
'astro-doctor/require-island-fallback': 'error', // or 'warn' or 'off'
},
},
]
Or in your doctor.config.ts:
export default {
rules: {
'astro-doctor/require-island-fallback': 'error',
},
}
All rules
-
astro-doctor/no-client-load-overuse -
astro-doctor/use-astro-image -
astro-doctor/require-image-dimensions -
astro-doctor/no-missing-alt -
astro-doctor/no-set-html -
astro-doctor/no-public-secret-env -
astro-doctor/prefer-class-list -
astro-doctor/no-blocking-script -
astro-doctor/no-unprocessed-script-surprises -
astro-doctor/no-missing-lang -
astro-doctor/require-island-fallback(this page) -
astro-doctor/no-process-env -
astro-doctor/prefer-content-collections