Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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))
}
};