3
votes

I'm using eslint(JavaScript Standard Style) with jest

lint keeps me warning about jest's functions are not defined.

I tried

/* eslint-env jest */

It works but, I don't want to use it in every test.js file. so I tried.

.eslintrc (in root directory)

{
    "env": {
        "jest": true
      }
}

but, doesn't work. any ideas?

1
I cannot reproduce this. Is your problem solved? - golopot
@golopot yes! thanks - JillAndMe
Can you post your solution please? - Daniel Eberl

1 Answers

9
votes

Using:

"env": {
    "jest": true
}

in the .eslintrc.json file, it solved the problem for me.