How to use the eslint-plugin-vue/lib/utils.isCustomComponent function in eslint-plugin-vue

To help you get started, we’ve selected a few eslint-plugin-vue 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 / click-events-have-key-events.js View on Github external
"VAttribute[directive=true][key.name.name='on'][key.argument.name='click']" (node) {
        const requiredEvents = ['keydown', 'keyup', 'keypress'];
        const element = node.parent.parent;
        if (VueUtils.isCustomComponent(element)) {
          return;
        } else if (
          utils.isHiddenFromScreenReader(element)
          || utils.isPresentationRole(element)
        ) {
          return;
        // } else if (isInteractiveElement(type, props)) {  // todo
        //   return;
        } else if (utils.hasAnyEvent(element, requiredEvents)) {
          return;
        }

        // Visible, non-interactive elements with click handlers require one keyboard event listener.
        context.report({
          node,
          message: errorMessage,