How to use the eslint-plugin-jsx-a11y/lib/rules/aria-role.js.create function in eslint-plugin-jsx-a11y

To help you get started, we’ve selected a few eslint-plugin-jsx-a11y examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github maranran / eslint-plugin-vue-a11y / lib / rules / aria-role.js View on Github external
const value = utils.getAttributeValue(node);
        if (value === null || typeof value !== 'string') {
          return;
        }
        const normalizedValues = String(value).toLowerCase().split(' ');
        const validRoles = [...roles.keys()].filter(role => roles.get(role).abstract === false);
        const isValid = normalizedValues.every(val => validRoles.indexOf(val) > -1);
        if (isValid === true) { return; }

        context.report({
          node: node,
          message: errorMessage
        });
      }
    }, altRule.create(context))
  }
};