Upgrading from 22.13.0 -> 22.13.1 fails on with `jest/globals` set in env
See original GitHub issueUpgrading 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:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i get why
because i open from parent directory of project, not project directory