How to use ESLint with Jest

后端 未结 9 1696
滥情空心
滥情空心 2020-12-07 11:56

I\'m attempting to use the ESLint linter with the Jest testing framework.

Jest tests run with some globals like jest, which I\'ll need to tell the lin

9条回答
  •  温柔的废话
    2020-12-07 12:28

    some of the answers assume you have 'eslint-plugin-jest' installed, however without needing to do that, you can simply do this in your .eslintrc file, add:

      "globals": {
        "jest": true,
      }
    

提交回复
热议问题