Search code examples
polymereslint

How to eslint a Web Component which includes another component?


I'm trying to eslint my Polymer Web Components, but every time I link another Component or Behavior, the usage thereof will be highlighted with a no-undef error. Of course I could add the following comment to any line with a no-undef error that is caused by includes, as a work-around:

// eslint-disable-line no-undef

But that's ugly, cumbersome and frustrating. Obviously, I don't want to completely disable no-undef.

Is there any solution I am failing to google? Any alternatives for eslint that work with Polymer and MS Visual Studio Code?


Solution

  • Polymer team recommends to use:

    1. https://github.com/Polymer/polymer-linter
    2. Together with eslint

    The polymer lintier is integrated in the Polymer CLI.

    This also applies to the upcoming Polymer 3 which is more ES6 centred.