We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6d06f9 commit c0fcecdCopy full SHA for c0fcecd
1 file changed
lib/rules/template-heading-level.js
@@ -13,8 +13,12 @@ const HEADING_RE = /^h([1-6])$/;
13
14
// Valid ARIA role tokens — used to find the first recognised token in a
15
// space-separated role-fallback list (WAI-ARIA §4.1). `presentation`/`none`
16
-// are included in aria-query's role map.
17
-const VALID_ROLE_TOKENS = new Set(ariaRoles.keys());
+// are included in aria-query's role map. Abstract roles (e.g. `widget`,
+// `structure`, `landmark`) are excluded: WAI-ARIA forbids authors from using
18
+// abstract roles as `role` attribute values.
19
+const VALID_ROLE_TOKENS = new Set(
20
+ [...ariaRoles.keys()].filter((name) => !ariaRoles.get(name).abstract)
21
+);
22
23
function extractLevel(tag) {
24
const match = HEADING_RE.exec(tag);
0 commit comments