Skip to content

Commit

Permalink
Oop,a ctually commit the set
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Goldberg committed Dec 3, 2021
1 parent 77f6c87 commit 1df7f13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rules/aria-role.js
Expand Up @@ -38,8 +38,8 @@ export default {
create: (context) => {
const options = context.options[0] || {};
const ignoreNonDOM = !!options.ignoreNonDOM;
const allowedInvalidRoles = new Set(options.allowedInvalidRoles || [])
const validRoles = [...roles.keys()].filter((role) => roles.get(role).abstract === false);
const allowedInvalidRoles = new Set(options.allowedInvalidRoles || []);
const validRoles = new Set([...roles.keys()].filter((role) => roles.get(role).abstract === false));

return ({
JSXAttribute: (attribute) => {
Expand All @@ -64,7 +64,7 @@ export default {
if (value === undefined || value === null) { return; }

const values = String(value).split(' ');
const isValid = values.every((val) => allowedInvalidRoles.has(val) || validRoles.indexOf(val) > -1);
const isValid = values.every((val) => allowedInvalidRoles.has(val) || validRoles.has(val));

if (isValid === true) { return; }

Expand Down

0 comments on commit 1df7f13

Please sign in to comment.