How to use the eslint-plugin-jsx-a11y/lib/rules/alt-text.js.create function in eslint-plugin-jsx-a11y

To help you get started, we’ve selected a few eslint-plugin-jsx-a11y examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github maranran / eslint-plugin-vue-a11y / lib / rules / alt-text.js View on Github external
"VElement" (node) {
        const nodeType = node.name
        if (!typesToValidate.has(nodeType)) { return  }
        let DOMElement = nodeType
        if (DOMElement === 'input') {
          DOMElement = 'input[type="image"]'
        }
        if (elementOptions.indexOf(DOMElement) === -1) {
          DOMElement = elementOptions.find((element) => {
            const customComponentsForElement = options[element] || []
            return customComponentsForElement.indexOf(nodeType) > -1
          })
        }
        ruleByElement[DOMElement](context, node)
      }
    }, altRule.create(context))
  }
}