jsx-a11y/scope
eslint-plugin-jsx-a11y
No autofixRecommended
eslint.config.js
import jsxA11y from "eslint-plugin-jsx-a11y";
export default [
{
plugins: { "jsx-a11y": jsxA11y },
rules: {
"jsx-a11y/scope": "error",
},
},
];<div scope /><th scope="col" />
<th scope={scope} />Examples from the ESLint documentation.
jsx-a11y/scope
eslint-plugin-jsx-a11y
import jsxA11y from "eslint-plugin-jsx-a11y";
export default [
{
plugins: { "jsx-a11y": jsxA11y },
rules: {
"jsx-a11y/scope": "error",
},
},
];jsx-a11y/scope
jsx-a11y plugin · correctness
{
"plugins": [
"jsx-a11y"
],
"rules": {
"jsx-a11y/scope": "error"
}
}a11y/noHeaderScope
a11y · since 1.0.0
{
"linter": {
"rules": {
"a11y": {
"noHeaderScope": "error"
}
}
}
}Enforce explicit role property is not the same as implicit/default role property on element.
Enforce distracting elements are not used.
Enforce that the accessKey prop is not used on any element to avoid complications with keyboard commands used by a screen reader.
Enforce <img> alt prop does not contain the word "image", "picture", or "photo".
Enforce iframe elements have a title attribute.
Enforce heading (h1, h2, etc) elements contain accessible content.