From ec187bec692a7ebbae056b846bac0366e538bbb0 Mon Sep 17 00:00:00 2001 From: MorevM Date: Sat, 22 Jun 2024 20:58:35 +0300 Subject: [PATCH] feat(jest): Add `jest/prefer-jest-mocked` rule --- configurations/jest/rules/jest.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configurations/jest/rules/jest.js b/configurations/jest/rules/jest.js index e99342bb..183e31ff 100644 --- a/configurations/jest/rules/jest.js +++ b/configurations/jest/rules/jest.js @@ -156,6 +156,10 @@ module.exports = { // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-importing-jest-globals.md 'jest/prefer-importing-jest-globals': 'off', + // Prefer `jest.mocked()` over fn as `jest.Mock` (autofixable) + // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-jest-mocked.md + 'jest/prefer-jest-mocked': 'warn', + // Enforce lowercase test names (autofixable) // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-lowercase-title.md 'jest/prefer-lowercase-title': 'off',