jsx-a11y/lang
eslint-plugin-jsx-a11y
No autofix
eslint.config.js
import jsxA11y from "eslint-plugin-jsx-a11y";
export default [
{
plugins: { "jsx-a11y": jsxA11y },
rules: {
"jsx-a11y/lang": "error",
},
},
];<html>
<html lang="foo"><html lang="en">
<html lang="en-US">Examples from the ESLint documentation.
jsx-a11y/lang
eslint-plugin-jsx-a11y
import jsxA11y from "eslint-plugin-jsx-a11y";
export default [
{
plugins: { "jsx-a11y": jsxA11y },
rules: {
"jsx-a11y/lang": "error",
},
},
];jsx-a11y/lang
jsx-a11y plugin · correctness
{
"plugins": [
"jsx-a11y"
],
"rules": {
"jsx-a11y/lang": "error"
}
}a11y/useValidLang
a11y · since 1.0.0
{
"linter": {
"rules": {
"a11y": {
"useValidLang": "error"
}
}
}
}Enforce <a> text to not exactly match "click here", "here", "link", or "a link".
Disallow aria-hidden="true" from being set on focusable elements.
Enforces using semantic DOM elements over the ARIA role property.
Non-interactive elements should not be assigned mouse or keyboard event listeners.
Enforce that autocomplete attributes are used correctly.
Enforce autoFocus prop is not used.