@jsxtools/eslint-plugin-jsx-a11y
Version:
Static AST checker for accessibility rules on JSX elements for flat ESLint Config.
13 lines (10 loc) • 363 B
JavaScript
import { getProp, getLiteralPropValue } from '../module/jsx-ast-utils.js';
function getImplicitRoleForMenu(attributes) {
const type = getProp(attributes, "type");
if (type) {
const value = getLiteralPropValue(type);
return value && value.toUpperCase() === "TOOLBAR" ? "toolbar" : "";
}
return "";
}
export { getImplicitRoleForMenu as default };