Eslint fails, unable to find jest version

Javascript :

KubernetesDockerRunner: Container for codacy/codacy-eslint:6.1.1 exited with non-zero code 1
Error: Error while loading rule 'jest/no-deprecated-functions': Unable to detect Jest version - please ensure jest package is installed, or otherwise set version explicitly
Occurred while linting /src/babel.config.js
    at detectJestVersion (/node_modules/eslint-plugin-jest/lib/rules/no-deprecated-functions.js:38:9)
    at create (/node_modules/eslint-plugin-jest/lib/rules/no-deprecated-functions.js:61:256)
    at Object.create (/node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js:13:24)
    at createRuleListeners (/node_modules/eslint/lib/linter/linter.js:761:21)
    at /node_modules/eslint/lib/linter/linter.js:931:31
    at Array.forEach (<anonymous>)
    at runRules (/node_modules/eslint/lib/linter/linter.js:876:34)
    at Linter._verifyWithoutProcessors (/node_modules/eslint/lib/linter/linter.js:1173:31)
    at Linter.<computed> (/node_modules/eslint-plugin-html/src/index.js:137:21)
    at Linter._verifyWithConfigArray (/node_modules/eslint/lib/linter/linter.js:1271:21)

TypeScript :

KubernetesDockerRunner: Container for codacy/codacy-eslint:6.1.1 exited with non-zero code 1
Error: Error while loading rule 'jest/no-deprecated-functions': Unable to detect Jest version - please ensure jest package is installed, or otherwise set version explicitly
Occurred while linting /src/src/utils/cookie.ts
    at detectJestVersion (/node_modules/eslint-plugin-jest/lib/rules/no-deprecated-functions.js:38:9)
    at create (/node_modules/eslint-plugin-jest/lib/rules/no-deprecated-functions.js:61:256)
    at Object.create (/node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js:13:24)
    at createRuleListeners (/node_modules/eslint/lib/linter/linter.js:761:21)
    at /node_modules/eslint/lib/linter/linter.js:931:31
    at Array.forEach (<anonymous>)
    at runRules (/node_modules/eslint/lib/linter/linter.js:876:34)
    at Linter._verifyWithoutProcessors (/node_modules/eslint/lib/linter/linter.js:1173:31)
    at Linter.<computed> (/node_modules/eslint-plugin-html/src/index.js:137:21)
    at Linter._verifyWithConfigArray (/node_modules/eslint/lib/linter/linter.js:1271:21)

How would I fix this?

Hi @Xenfo , thanks for reporting this!

Can you please tell me the repo / commit where you are getting this message so I can dig into it?

Regards,
Ivo

1 Like

Hi @Xenfo, thank you for letting us know about this!
We were wondering if you’re still seeing this? If you do, as Ivo mentioned, please do share with us the repo or commit so we take a look at it. Thanks again!

Hi @Xenfo,
There is a bug in our ESLint wrapper with the jest plugin you just found.
I opened a PR right now to fix it: fix: Fix jest/no-deprecated-functions by lolgab · Pull Request #1294 · codacy/codacy-eslint · GitHub
It should go live today :slight_smile:

2 Likes