admin管理员组文章数量:1316844
In my Next/React/Typescript/Jest project I'm trying to configure my eslint config. After updating to version 8.x (currently 8.0.1), the linter throws following error:
Error: .eslintrc.js » ./eslint/config.js:
Environment key "jest/globals" is unknown
Then I added 'plugin:jest/remended'
to the extends
array in my config.js
, which led me to this error:
TypeError: Failed to load plugin 'jest' declared in '.eslintrc.js » ./eslint/config.js': Class extends value undefined is not a constructor or null
The plugin is installed and inside my package.json
. Even several npm ci
haven't helped me here.
Would appreciate ideas !
In my Next/React/Typescript/Jest project I'm trying to configure my eslint config. After updating to version 8.x (currently 8.0.1), the linter throws following error:
Error: .eslintrc.js » ./eslint/config.js:
Environment key "jest/globals" is unknown
Then I added 'plugin:jest/remended'
to the extends
array in my config.js
, which led me to this error:
TypeError: Failed to load plugin 'jest' declared in '.eslintrc.js » ./eslint/config.js': Class extends value undefined is not a constructor or null
The plugin is installed and inside my package.json
. Even several npm ci
haven't helped me here.
Would appreciate ideas !
Share Improve this question asked Oct 18, 2021 at 7:47 dsudodsudo 1934 silver badges23 bronze badges1 Answer
Reset to default 9Are you using any other eslint plugins? If so, has npm warned you of any peer dependency issues?
I ran into this same issue when upgrading to eslint v8.0.1. In may case, one plugin I listed an an earlier version of @typescript-eslint/eslint-plugin
as a direct dependency (@typescript-eslint/eslint-plugin
is also a peer dependency of eslint-plugin-jest
). This earlier version of @typescript-eslint/eslint-plugin
was not patible with eslint
v8.0.1. So I opted to downgrade to v7.32.0
If you have control over the other plugins you use, you might upgrade their dependencies and publish a new release. Else, you'll probably have to downgrade eslint
in your project.
本文标签: javascriptEslint 801implementing jest into config throws an errorStack Overflow
版权声明:本文标题:javascript - Eslint 8.0.1 - implementing jest into config throws an error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742013158a2413270.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论