Performance warn by default
astro-doctor/no-client-load-overuse no-client-load-overuse
Prefer client:idle or client:visible over client:load for interactive islands.
Why
client:load hydrates the component immediately, blocking the main thread during page startup. client:idle waits for the browser to be idle; client:visible waits until the element enters the viewport — both give the critical path a head start.
Examples
✗ Incorrect
Uses client:load unnecessarily
---
import Counter from '../components/Counter'
---
<Counter client:load /> ✓ Correct
Uses client:idle (below the fold) or client:visible
---
import Counter from '../components/Counter'
---
<!-- Below-the-fold component: hydrate when browser is idle -->
<Counter client:idle />
<!-- Only visible when scrolled into view -->
<Counter client:visible /> 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/no-client-load-overuse': 'error', // or 'warn' or 'off'
},
},
]
Or in your doctor.config.ts:
export default {
rules: {
'astro-doctor/no-client-load-overuse': 'error',
},
}
All rules
-
astro-doctor/no-client-load-overuse(this page) -
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 -
astro-doctor/no-process-env -
astro-doctor/prefer-content-collections