Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"VStartTag" (node) {
const element = node.parent;
const type = utils.getElementType(element);
const role = utils.getRoleValue(element)
if (!role) {
return
}
if (!dom.get(type)) {
return;
}
const normalizedRoles = String(role).toLowerCase().split(' ');
const roleArray = [...roles.keys()];
const validRoles = normalizedRoles.filter(value => roleArray.indexOf(value) > -1)
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),
});
}
}
})
}
const validRoles = [...roles.keys()].filter(role => roles.get(role).abstract === false);
const isValid = normalizedValues.every(val => validRoles.indexOf(val) > -1);
const utils = require('eslint-plugin-vue/lib/utils');
const assert = require('assert');
const { roles, elementRoles, dom } = require('aria-query');
const rolesArray = [...roles.keys()];
const validRoles = rolesArray.filter(name => !roles.get(name).abstract)
const interactiveRoles = validRoles
.filter(name => roles.get(name).superClass.some(klasses => klasses.indexOf('widget') !== -1));
interactiveRoles.push('toolbar');
const nonInteractiveRoles = validRoles
.filter(name => !roles.get(name).superClass.some(klasses => klasses.indexOf('widget') !== -1));
const nonInteractiveElementRole = [...elementRoles].reduce((accumulator, [element, roles]) => {
if ([...roles].every(role => nonInteractiveRoles.indexOf(role) !== -1)) {
accumulator.push(element);
}
return accumulator;
}, []);
const interactiveElementRole = [...elementRoles].reduce((accumulator, [element, roles]) => {
if ([...roles].some(role => interactiveRoles.indexOf(role) !== -1)) {