How to use the eslint-plugin-jsx-a11y/lib/rules/iframe-has-title.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 / iframe-has-title.js View on Github external
create (context) {
    return VueUtils.defineTemplateBodyVisitor(context, {
      "VElement[name='iframe']" (node) {
        const title = utils.getAttribute(node, 'title');
        const titleValue = utils.getAttributeValue(node, 'title');
        if (title && typeof titleValue === 'string' || typeof titleValue === 'object') {
          return;
        }

        context.report({
          node,
          message: errorMessage,
        });
      }
    }, altRule.create(context))
  }
};