How to use the eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props.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 / role-has-required-aria-props.js View on Github external
validRoles.forEach((role) => {
          const { requiredProps: requiredPropKeyValues } = roles.get(role);
          const requiredProps = Object.keys(requiredPropKeyValues);

          if (requiredProps.length > 0) {
            const hasRequiredProps = requiredProps.every(prop => utils.getAttribute(element, prop) !== undefined)
            if (!hasRequiredProps) {
              context.report({
                node,
                message: errorMessage(role.toLowerCase(), requiredProps),
              });
            }
          }
        })
      }
    }, altRule.create(context))
  }
};