Skip to contentView the source on GitHub

require-island-fallback

Require fallback content for client-only and deferred server islands.

Accessibilitywarning by default ESLint rule

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

astroIncorrect example
---
import Chart from '../components/Chart.tsx'
---
<Chart client:only="react" />

Correct

Island with fallback content

astroCorrect example
---
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:

javascripteslint.config.js
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:

typescriptdoctor.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.

Keep exploring accessibility

Browse every rule and project audit