Skip to content

useAstroClientOnlyDirectiveValue

biome.json
{
"linter": {
"rules": {
"nursery": {
"useAstroClientOnlyDirectiveValue": "error"
}
}
}
}

Require a value for Astro’s client:only directive.

client:only skips server rendering, so Astro needs a framework value to select the client renderer.

<Component client:only />
code-block.astro:1:12 lint/nursery/useAstroClientOnlyDirectiveValue ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

client:only is missing a framework value.

> 1 │ <Component client:only />
^^^^^^^^^^^
2 │

Astro skips server rendering for client:only, so it cannot infer which renderer should load the component.

Add the component framework as the directive value, for example client:only=“react”.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<Component client:only="react" />

Dynamic expression values are accepted without resolving their bindings.

<Component client:only={renderer} />

The rule only checks whether an initializer is present. Empty values are accepted.