eslint: Environment key "jest/globals" is unknown
I’m getting this error on a fresh install of create-nuxt-app with linting tools of eslint and prettier enabled
> eslint --ext .js,.vue --ignore-path .gitignore . "--fix"
Error: .eslintrc.js » @nuxtjs/eslint-config-typescript » @nuxtjs/eslint-config:
Environment key "jest/globals" is unknown
at /home/kdjs8967/nuxtjs-test/node_modules/eslint/lib/shared/config-validator.js:169:19
at Array.forEach (<anonymous>)
at validateEnvironment (/home/kdjs8967/nuxtjs-test/node_modules/eslint/lib/shared/config-validator.js:163:30)
at validateConfigArray (/home/kdjs8967/nuxtjs-test/node_modules/eslint/lib/shared/config-validator.js:334:9)
at CascadingConfigArrayFactory._finalizeConfigArray (/home/kdjs8967/nuxtjs-test/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:417:13)
at CascadingConfigArrayFactory.getConfigArrayForFile (/home/kdjs8967/nuxtjs-test/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:271:21)
at FileEnumerator._iterateFilesRecursive (/home/kdjs8967/nuxtjs-test/node_modules/eslint/lib/cli-engine/file-enumerator.js:396:49)
at _iterateFilesRecursive.next (<anonymous>)
at FileEnumerator.iterateFiles (/home/kdjs8967/nuxtjs-test/node_modules/eslint/lib/cli-engine/file-enumerator.js:251:49)
at iterateFiles.next (<anonymous>)
The .eslintrc.js is the default one
module.exports = {
root: true,
env: {
browser: true,
node: true
},
extends: [
'@nuxtjs/eslint-config-typescript',
'prettier',
'prettier/vue',
'plugin:prettier/recommended',
'plugin:nuxt/recommended'
],
plugins: [
'prettier'
],
// add your custom rules here
rules: {
}
}
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 16 (2 by maintainers)
This issue has been fix in latest eslint-config by updating eslint and jest plugin.
Can you try:
we should re-open this @minblake
Weird I just ran into this issue after upgrading to eslint 8.0.0 I guess
Is there any special reason you are depending on
eslint-plugin-jest? I know it may seem hard to believe, but some of us neither use jest nor want to install it. Making jest a hard-coded dependency to lint Nuxt code seems a bit opinionated.@buecki Yeah, same thing happend to me. Strange… Anyways, thank you!
If you specify latest tag, the package will be updated to latest tag which includes major release.
I run into this today. Already deleted
package-lockandnode-modulesand reinstalled everything, didn’t help 😦I do not have typescript or jest
Version 3 of “@nuxtjs/eslint-config-typescript” doesn’t work at the moment. Same error.
Couldn’t figure out, but upgrading eslint worked for me: