useHtmlLang
Ta treść nie jest jeszcze dostępna w Twoim języku.
Summary
Section titled “Summary”- Rule available since: 
v1.0.0 - Diagnostic Category: 
lint/a11y/useHtmlLang - This rule is recommended, which means is enabled by default.
 - This rule doesn’t have a fix.
 - The default severity of this rule is error.
 - Sources:
- Same as 
jsx-a11y/html-has-lang 
 - Same as 
 
How to configure
Section titled “How to configure”{  "linter": {    "rules": {      "a11y": {        "useHtmlLang": "error"      }    }  }}Description
Section titled “Description”Enforce that html element has lang attribute.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<html></html>code-block.jsx: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 languageused by screen readers when no user default is specified.
  
<html lang={""}></html>code-block.jsx: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 languageused by screen readers when no user default is specified.
  
<html lang={null}></html>code-block.jsx:1:1 lint/a11y/useHtmlLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Provide a lang attribute when using the html element.
  
  > 1 │ <html lang={null}></html>
      │ ^^^^^^^^^^^^^^^^^^
    2 │ 
  
  ℹ Setting a lang attribute on HTML document elements configures the languageused by screen readers when no user default is specified.
  
<html lang={undefined}></html>code-block.jsx:1:1 lint/a11y/useHtmlLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Provide a lang attribute when using the html element.
  
  > 1 │ <html lang={undefined}></html>
      │ ^^^^^^^^^^^^^^^^^^^^^^^
    2 │ 
  
  ℹ Setting a lang attribute on HTML document elements configures the languageused by screen readers when no user default is specified.
  
<html lang={true}></html>code-block.jsx:1:1 lint/a11y/useHtmlLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Provide a lang attribute when using the html element.
  
  > 1 │ <html lang={true}></html>
      │ ^^^^^^^^^^^^^^^^^^
    2 │ 
  
  ℹ Setting a lang attribute on HTML document elements configures the languageused by screen readers when no user default is specified.
  
<html lang="en"></html><html lang={language}></html><html {...props}></html><html lang={""} {...props}></html>Accessibility guidelines
Section titled “Accessibility guidelines”Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.