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

Disallow requiring from invariant/warning #19633

Closed
wants to merge 1 commit into from
Closed

Conversation

elicwhite
Copy link
Member

In this repo we have to require from fbjs/lib/invariant and issues occur when we require directly from invariant/warning. Flow doesn't complain about those requires right now because we have a transitive dependency on invariant and warning causing them to happen to be at the root of node_modules.

This change blacklists requiring directly from invariant and warning using Flow. @janicduplessis opened a pull request to do this with ESLint back in 2017: #13014

Test Plan:
I changed a require to point to invariant instead of fbjs/lib/invariant, got the warning:
screen shot 2018-06-08 at 9 39 19 pm

@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 Jun 9, 2018
@elicwhite
Copy link
Member Author

Whoops. Didn't mean to push the branch to this repo. Closing in favor of #19634

@elicwhite elicwhite closed this Jun 9, 2018
@hramos hramos deleted the disallow-invariant branch February 25, 2020 19:19
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants