require-island-fallback
Require fallback content for client-only and deferred server islands.
astro-doctor/require-island-fallback
Why it matters
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.
See the difference
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>Configure this check
Override the default severity in your ESLint config:
import astroDoctorPlugin from '@santi020k/eslint-plugin-astro-doctor'
export default [
astroDoctorPlugin.configs.recommended,
{
rules: {
'astro-doctor/require-island-fallback': 'error',
},
},
]Or set the severity for CLI scans in doctor.config.ts:
export default {
rules: {
'astro-doctor/require-island-fallback': 'error',
},
}Use 'error', 'warn', or 'off'. The configuration guide covers presets and per-file overrides.