如何 eslint 包含另一个组件的 Web 组件?

How to eslint a Web Component which includes another component?

我正在尝试 eslint 我的 Polymer Web 组件,但每次我 link 另一个组件或行为时,它们的用法都会用 no-undef[=20= 突出显示] 错误。 当然,我可以将以下注释添加到任何由 include 引起的 no-undef 错误的行,作为解决方法:

// eslint-disable-line no-undef

但这很丑陋、麻烦且令人沮丧。显然,我不想完全禁用 no-undef.

有没有什么解决方案我没能做到google?任何可与 Polymer and MS Visual Studio Code 一起使用的 eslint 替代品?

聚合物团队 recommends 使用:

  1. https://github.com/Polymer/polymer-linter
  2. 与eslint一起

聚合物绒布集成在 Polymer CLI 中。

这也适用于即将推出的更加以 ES6 为中心的 Polymer 3。