jsx-a11y/aria-unsupported-elements
eslint-plugin-jsx-a11y
import jsxA11y from "eslint-plugin-jsx-a11y";
export default [
{
plugins: { "jsx-a11y": jsxA11y },
rules: {
"jsx-a11y/aria-unsupported-elements": "error",
},
},
];Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes.
<!-- Bad: the meta element should not be given any ARIA attributes -->
<meta charset="UTF-8" aria-hidden="false" /><!-- Good: the meta element should not be given any ARIA attributes -->
<meta charset="UTF-8" />Examples from the ESLint documentation.
jsx-a11y/aria-unsupported-elements
eslint-plugin-jsx-a11y
import jsxA11y from "eslint-plugin-jsx-a11y";
export default [
{
plugins: { "jsx-a11y": jsxA11y },
rules: {
"jsx-a11y/aria-unsupported-elements": "error",
},
},
];jsx-a11y/aria-unsupported-elements
jsx-a11y plugin · correctness
{
"plugins": [
"jsx-a11y"
],
"rules": {
"jsx-a11y/aria-unsupported-elements": "error"
}
}a11y/noAriaUnsupportedElements
a11y · since 1.0.0
{
"linter": {
"rules": {
"a11y": {
"noAriaUnsupportedElements": "error"
}
}
}
}Enforce ARIA state and property values are valid.
Enforce that elements with ARIA roles must have all required attributes for that role.
Enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role.
Enforce all elements that require alternative text have meaningful information to relay back to end user.
Enforce all anchors to contain accessible content.