Skip to content

Commit 521fb6d

Browse files
elicwhitefacebook-github-bot
authored andcommittedJun 9, 2018
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
1 parent c55bcd6 commit 521fb6d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎.flowconfig

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
; Ignore metro
2626
.*/node_modules/metro/.*
2727

28+
; These should not be required directly
29+
; require from fbjs/lib instead: require('fbjs/lib/invariant')
30+
.*/node_modules/invariant/.*
31+
.*/node_modules/warning/.*
32+
2833
[include]
2934

3035
[libs]

0 commit comments

Comments
 (0)
Please sign in to comment.