no-abstract-role
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: warnhtml/html-validate-standard
What it does
Section titled “What it does”Reports a role that is one of the abstract roles of the ARIA taxonomy (widget, landmark, command, …).
Why it matters
Section titled “Why it matters”Abstract roles exist to define the other roles and must not be used in content. Assistive technology ignores them, so the element has no role at all.
To fix, use a concrete role, or a native element.
Example
Section titled “Example”...<h2><img src="a.png" alt="x"></h2><h3>text</h3><div role="widget"></div><div role="button"></div>...<button type="button">Go</button>...Configuration
Section titled “Configuration”angular: lint: rules: no-abstract-role: warn # off, warn (default), errorhtml: lint: rules: no-abstract-role: warn # off, warn (default), errorsvelte: lint: rules: no-abstract-role: warn # off, warn (default), errorvue: lint: rules: no-abstract-role: warn # off, warn (default), errorEnabled by the presets: html/html-validate-standard.
Suppress one line with sudsy-disable-next-line no-abstract-role in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| html-eslint | no-abstract-roles |
full |
| html-validate | no-abstract-role |
full |