Skip to content

Commit

Permalink
Disallow requiring from invariant/warning (#19634)
Browse files Browse the repository at this point in the history
Summary:
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
Closes #19634

Reviewed By: hramos

Differential Revision: D8343060

Pulled By: TheSavior

fbshipit-source-id: 9cfc7915b2fb68a567355fc2f5edc4dfcd46f4af
  • Loading branch information
elicwhite authored and facebook-github-bot committed Jun 9, 2018
1 parent c55bcd6 commit 521fb6d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
; Ignore metro
.*/node_modules/metro/.*

; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/invariant')
.*/node_modules/invariant/.*
.*/node_modules/warning/.*

[include]

[libs]
Expand Down

0 comments on commit 521fb6d

Please sign in to comment.