diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index 8118152f..cf130f27 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -25,13 +25,17 @@ const hasTypescript = hasConfig([ { type: 'file', pattern: 'tsconfig.json' }, ]); -let settings; +// We explicitly set the Jest version because auto-detection doesn't work in the monorepo. +// Ref: https://github.com/jest-community/eslint-plugin-jest/pull/564/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5 +const settings = { + jest: { + version: 24, + }, +}; if (hasReact) { - settings = { - react: { - version: 'detect', - }, + settings.react = { + version: 'detect', }; } diff --git a/packages/web-scripts/src/Tasks/AuditTasks/index.test.ts b/packages/web-scripts/src/Tasks/AuditTasks/index.test.ts index cd35aad1..e804d26d 100644 --- a/packages/web-scripts/src/Tasks/AuditTasks/index.test.ts +++ b/packages/web-scripts/src/Tasks/AuditTasks/index.test.ts @@ -81,6 +81,7 @@ describe('web-scripts audit', () => { restOptions: ['--cwd', source], }); + /* eslint jest/no-conditional-expect: off */ if (status) expect(process.exit).toHaveBeenCalledWith(status); else expect(process.exit).not.toHaveBeenCalled(); },