How to use the eslint-plugin-jsx-a11y/lib/rules/anchor-has-content.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 / anchor-has-content.js View on Github external
const componentOptions = options.components || [];
        const typeCheck = ['a'].concat(componentOptions);
        const parent = node.parent;
        const nodeType = utils.getElementType(parent);
        if (typeCheck.indexOf(nodeType) === -1) {
          return;
        } else if (utils.hasAccessibleChild(parent)) {
          return;
        }

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