Skip to content

useHtmlLang (HTML)

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

Enforce that html element has lang attribute.

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