Permalink
Browse files

Disallow requiring from invariant/warning (#19634)

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...
TheSavior authored and facebook-github-bot committed Jun 9, 2018
1 parent c55bcd6 commit 521fb6d041167ec8a8d0e98ac606db1f27f0c5c8
Showing with 5 additions and 0 deletions.
  1. +5 −0 .flowconfig
View
@@ -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]

0 comments on commit 521fb6d

Please sign in to comment.