Skip to content

Commit

Permalink
fix(eslint-config): use jest version setting to fix no-deprecated-fun…
Browse files Browse the repository at this point in the history
…ctions functionality
  • Loading branch information
spotify-kai committed Apr 6, 2021
1 parent 7d8b247 commit 9a67198
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/web-scripts/src/Tasks/AuditTasks/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down

0 comments on commit 9a67198

Please sign in to comment.