From 521fb6d041167ec8a8d0e98ac606db1f27f0c5c8 Mon Sep 17 00:00:00 2001 From: Eli White Date: Sat, 9 Jun 2018 10:57:39 -0700 Subject: [PATCH] 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 --- .flowconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.flowconfig b/.flowconfig index 0d576609315e64..10c13ea400f5ec 100644 --- a/.flowconfig +++ b/.flowconfig @@ -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]