代码之家  ›  专栏  ›  技术社区  ›  Gobliins

Atom linter/es lint禁用某些警告[重复]

  •  1
  • Gobliins  · 技术社区  · 8 年前

    我正在用wdio和mocha框架以及我的linter包编写一些测试 https://atom.io/packages/linter https://atom.io/packages/linter-eslint

    describe('[On Board]', () => { //describe is not defined
      before(() => {  // before is not defined
        browser.waitUntil() //browser is not defined
        ....
    

    未定义的内容将由wdio/mocha Testrunner处理,因此我想告诉我的linter/es lint包忽略这个问题。

    1 回复  |  直到 8 年前
        1
  •  0
  •   Tavish Aggarwal    8 年前

    有两种选择:

    1. 或者包括命名空间,其中 describe 定义了其他变量。
    2. 或者你可以更新。jshintrc使linter知道您正在使用mocha框架,并忽略错误。 有帮助的链接: LINK