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: https://github.com/facebook/react-native/pull/13014
Closes https://github.com/facebook/react-native/pull/19634

Reviewed By: hramos

Differential Revision: D8343060

Pulled By: TheSavior

fbshipit-source-id: 9cfc7915b2fb68a567355fc2f5edc4dfcd46f4af
This commit is contained in:
Eli White 2018-06-09 10:57:39 -07:00 committed by Facebook Github Bot
parent c55bcd6ea7
commit 521fb6d041
1 changed files with 5 additions and 0 deletions

View File

@ -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]