Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow jest globals in __mocks__ directories #25738

Conversation

artdent
Copy link
Contributor

@artdent artdent commented Jul 19, 2019

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

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.

The `__mocks__` directories should be treated the same as `__tests__`
for the purpose of linting. See https://jestjs.io/docs/en/manual-mocks
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 19, 2019
Copy link

@analysis-bot analysis-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code analysis results:

  • eslint found some issues. Run yarn lint --fix to automatically fix problems.

packages/eslint-config-react-native-community/index.js Outdated Show resolved Hide resolved
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@osdnk is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@osdnk
Copy link
Contributor

osdnk commented Jul 26, 2019

Thanks!

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @artdent in e78c013.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jul 26, 2019
@artdent artdent deleted the eslint-config-react-native-community-mocks branch December 13, 2019 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants