UNPKG

@jsxtools/eslint-plugin-jsx-a11y

Version:

Static AST checker for accessibility rules on JSX elements for flat ESLint Config.

14 lines (11 loc) 429 B
import { getProp } from './module/jsx-ast-utils.js'; import getTabIndex from './getTabIndex.js'; import isInteractiveElement from './isInteractiveElement.js'; function isFocusable(type, attributes) { const tabIndex = getTabIndex(getProp(attributes, "tabIndex")); if (isInteractiveElement(type, attributes)) { return tabIndex === void 0 || tabIndex >= 0; } return tabIndex >= 0; } export { isFocusable as default };