Environment key "jest/globals" is unknown

See original GitHub issue

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: {
  }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
acidjazzcommented, Oct 20, 2021

we should re-open this @minblake

4reactions
mrleblanc101commented, Oct 13, 2021

Weird I just ran into this issue after upgrading to eslint 8.0.0 I guess

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eslint jest/globals environment key unknown - Stack Overflow
If you're getting Environment key "cypress/globals" is unknown the fix is similar, to add the plugin in plugins array. But it must be...
Read more >
Environment key "jest/globals" is unknown · Issue #44 - GitHub
I believe ESLint processes the configuration file as it reads it, so try declaring the env block after the extends block.
Read more >
Environment key "jest/globals" is unknown - Code Grepper
Environment key "jest/globals" is unknown - react ; 1. "env": { ; 2. "jest/globals": true ; 3. }.
Read more >
How to solve this error: package.json » eslint-config-react-app ...
[Solved]-How to solve this error: package.json » eslint-config-react-app/jest#overrides[0]: Environment key "jest/globals" is unknown-Reactjs.
Read more >
Globals - Jest
In your test files, Jest puts each of these methods and objects into the global environment. You don't have to require or import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found