Skip to content

Commit e78c013

Browse files
artdentfacebook-github-bot
authored andcommitted
Allow jest globals in __mocks__ directories (#25738)
Summary: The `__mocks__` directories should be treated the same as `__tests__` for the purpose of linting. See https://jestjs.io/docs/en/manual-mocks ## Changelog [Internal] [Changed] - eslint: allow jest globals in `__mocks__` directories Pull Request resolved: #25738 Test Plan: I installed the updated package locally in my project and verified that the `no-undef` rule no longer fires for references to `jest` in `__mocks__` directories. Differential Revision: D16515546 Pulled By: osdnk fbshipit-source-id: ae78b95d33d1b48ffa4aafa7a53c83e152d176b2
1 parent 9115b61 commit e78c013

File tree

1 file changed

+4
-1
lines changed
  • packages/eslint-config-react-native-community

1 file changed

+4
-1
lines changed

packages/eslint-config-react-native-community/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ module.exports = {
5858
},
5959
},
6060
{
61-
files: ['*.{spec,test}.{js,ts,tsx}', '**/__tests__/**/*.{js,ts,tsx}'],
61+
files: [
62+
'*.{spec,test}.{js,ts,tsx}',
63+
'**/__{mocks,tests}__/**/*.{js,ts,tsx}',
64+
],
6265
env: {
6366
jest: true,
6467
'jest/globals': true,

0 commit comments

Comments
 (0)