no-abstract-roles
This rule disallows the use of abstract ARIA roles.
How to use
module.exports = {
rules: {
"@html-eslint/no-abstract-roles": "error",
},
};
Rule Details
Abstract roles are part of the ARIA (Accessible Rich Internet Applications) specification, but they are not intended for direct use in HTML. Using these roles has no effect and may lead to accessibility issues.
The following abstract roles are disallowed by this rule:
- Abstract roles
- command
- composite
- input
- landmark
- range
- roletype
- section
- sectionhead
- select
- structure
- widget
- window
Examples of incorrect code for this rule:
<div role="command"></div>
<div role="composite"></div>
<div role="input"></div>
Examples of correct code for this rule:
<div role="button"></div>