question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrading from 22.13.0 -> 22.13.1 fails on with `jest/globals` set in env

See original GitHub issue

Upgrading from 22.13.0 to 22.13.1 is now causing the following error for us:

$ eslint --ext .js,.md,.vue ./
Error: .eslintrc.js:
	Environment key "jest/globals" is unknown

    at /home/circleci/project/node_modules/eslint/lib/shared/config-validator.js:169:19
    at Array.forEach (<anonymous>)
    at validateEnvironment (/home/circleci/project/node_modules/eslint/lib/shared/config-validator.js:163:30)
    at validateConfigArray (/home/circleci/project/node_modules/eslint/lib/shared/config-validator.js:334:9)
    at CascadingConfigArrayFactory._finalizeConfigArray (/home/circleci/project/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:392:13)
    at CascadingConfigArrayFactory.getConfigArrayForFile (/home/circleci/project/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:248:21)
    at FileEnumerator._iterateFilesRecursive (/home/circleci/project/node_modules/eslint/lib/cli-engine/file-enumerator.js:400:49)
    at _iterateFilesRecursive.next (<anonymous>)
    at FileEnumerator.iterateFiles (/home/circleci/project/node_modules/eslint/lib/cli-engine/file-enumerator.js:254:49)
    at iterateFiles.next (<anonymous>)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Exited with code 2

Our .eslintrc.js file:

module.exports = {
  extends: ['standard', 'plugin:vue/recommended', 'plugin:prettier/recommended'],
  plugins: ['jest', 'markdown', 'node', 'promise'],
  parserOptions: {
    parser: 'babel-eslint',
    sourceType: 'module'
  },
  env: {
    browser: true,
    es6: true,
    'jest/globals': true
  },
  globals: {
    Vue: true
  },
  rules: {
    'spaced-comment': 'off', // needed to ignore `/*#__PURE__*/` comments
    'vue/html-self-closing': [
      'error',
      {
        html: {
          void: 'never',
          normal: 'never',
          component: 'never'
        }
      }
    ],
    'vue/max-attributes-per-line': ['error', { singleline: 4 }],
    'vue/no-template-shadow': 'off',
    'vue/no-use-v-if-with-v-for': 'off',
    'vue/no-v-html': 'off',
    'vue/require-default-prop': 'off',
    'vue/require-prop-types': 'off',
    'vue/singleline-html-element-content-newline': 'off'
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
scarcococommented, Aug 11, 2019

i get why

because i open from parent directory of project, not project directory

0reactions
scarcococommented, Aug 11, 2019
react-info

System:
    OS: macOS High Sierra 10.13.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 3.31 GB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.7.0 - ~/.nvm/versions/node/v12.7.0/bin/node
    Yarn: 1.17.3 - ~/.nvm/versions/node/v12.7.0/bin/yarn
    npm: 6.10.0 - ~/.nvm/versions/node/v12.7.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    Android SDK:
      API Levels: 25, 26, 27, 28
      Build Tools: 25.0.2, 26.0.2, 27.0.3, 28.0.1, 28.0.3
      System Images: android-19 | ARM EABI v7a, android-19 | Intel x86 Atom, android-19 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
      Android NDK: 19.2.5345600
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 10.1/10B61 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.4 => 0.60.4
  npmGlobalPackages:
    react-native-cli: 2.0.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eslint jest/globals environment key unknown - Stack Overflow
I have the main set to an index which just extends other files. Long story I have a jest config file. That looks...
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 >
eslint-plugin-jest: Versions - Openbase
Full version history for eslint-plugin-jest including change logs. ... ensure jest globals are enabled in styles config (#1241) (a165e98) ...
Read more >
eslint-plugin-jest - npm
Start using eslint-plugin-jest in your project by running `npm i ... any global Jests you have aliased using the globalAliases setting:.
Read more >
Cannot find module '@jest/globals' from 'abc.test.js'
This was an unfortunate mismatch between dependencies of dependencies when using the base LWC Jest testing packages.
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