Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions lib/rules/template-no-abstract-roles.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
const PROHIBITED_ROLE_VALUES = new Set([
'command',
'composite',
'input',
'landmark',
'range',
'roletype',
'section',
'sectionhead',
'select',
'structure',
'widget',
'window',
]);
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)
);

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
Expand Down
Loading