eslint-plugin-vuejs-accessibility
Version:
An eslint plugin for checking Vue.js files for accessibility
17 lines (16 loc) • 603 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
function getElementAttribute(node, name) {
for (const attribute of node.startTag.attributes) {
if ((!attribute.directive && attribute.key.name === name) ||
(attribute.directive &&
attribute.key.name.name === "bind" &&
attribute.key.argument &&
attribute.key.argument.type === "VIdentifier" &&
attribute.key.argument.name === name)) {
return attribute;
}
}
return null;
}
exports.default = getElementAttribute;
;