We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e81aeb2 + d70a2b6 commit 8ec2dc9Copy full SHA for 8ec2dc9
1 file changed
lib/rules/template-no-abstract-roles.js
@@ -1,17 +1,11 @@
1
-const PROHIBITED_ROLE_VALUES = new Set([
2
- 'command',
3
- 'composite',
4
- 'input',
5
- 'landmark',
6
- 'range',
7
- 'roletype',
8
- 'section',
9
- 'sectionhead',
10
- 'select',
11
- 'structure',
12
- 'widget',
13
- 'window',
14
-]);
+const { roles } = require('aria-query');
+
+// Abstract ARIA roles, sourced from aria-query. Abstract roles exist only for
+// taxonomy — authors should never set role="widget" / "landmark" / etc.
+// https://www.w3.org/TR/wai-aria-1.2/#abstract_roles
+const PROHIBITED_ROLE_VALUES = new Set(
+ [...roles.keys()].filter((role) => roles.get(role).abstract)
+);
15
16
/** @type {import('eslint').Rule.RuleModule} */
17
module.exports = {
0 commit comments