Skip to content

useHtmlLang (HTML)

biome.json
{
"linter": {
"rules": {
"a11y": {
"useHtmlLang": "error"
}
}
}
}

Require a lang attribute on the <html> element.

The language tag helps screen readers choose the correct pronunciation rules when the user has not selected a default language. A static HTML value must be non-empty. Vue bindings are accepted without evaluating the value they produce at runtime.

<html></html>
code-block.html:1:1 lint/a11y/useHtmlLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ Provide a lang attribute when using the html element.

> 1 │ <html></html>
│ ^^^^^^
2 │

ℹ Setting a lang attribute on HTML document elements configures the language used by screen readers when no user default is specified.

<html lang=""></html>
code-block.html:1:1 lint/a11y/useHtmlLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ Provide a lang attribute when using the html element.

> 1 │ <html lang=""></html>
│ ^^^^^^^^^^^^^^
2 │

ℹ Setting a lang attribute on HTML document elements configures the language used by screen readers when no user default is specified.

<html lang="en"></html>