Skip to content

no-abstract-role

Reports a role that is one of the abstract roles of the ARIA taxonomy (widget, landmark, command, …).

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.

Reported
...
<h2><img src="a.png" alt="x"></h2>
<h3>text</h3>
<div role="widget"></div>
<div role="button"></div>
...
<button type="button">Go</button>
...
angular:
lint:
rules:
no-abstract-role: warn # off, warn (default), error
html:
lint:
rules:
no-abstract-role: warn # off, warn (default), error
svelte:
lint:
rules:
no-abstract-role: warn # off, warn (default), error
vue:
lint:
rules:
no-abstract-role: warn # off, warn (default), error

Enabled 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.

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