From 843a433e87b0ccaa64ab70d07e22bffbabad8045 Mon Sep 17 00:00:00 2001 From: Eli White Date: Mon, 18 Jun 2018 15:53:57 -0700 Subject: [PATCH] Update react-native init's flowconfig Summary: Fixes https://github.com/facebook/react-native/issues/19766 On a clean project flow was complaining about `Cannot resolve module X` because of the removal of `providesModule`. This resolves the errors. Reviewed By: rubennorte Differential Revision: D8500303 fbshipit-source-id: 4e129ee4382f8ff36ab126e9f6c6530254cd382e --- local-cli/templates/HelloWorld/_flowconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/local-cli/templates/HelloWorld/_flowconfig b/local-cli/templates/HelloWorld/_flowconfig index 2f3267d31..f99d3024b 100644 --- a/local-cli/templates/HelloWorld/_flowconfig +++ b/local-cli/templates/HelloWorld/_flowconfig @@ -30,6 +30,19 @@ node_modules/react-native/flow-github/ emoji=true module.system=haste +module.system.haste.use_name_reducers=true +# get basename +module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' +# strip .js or .js.flow suffix +module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1' +# strip .ios suffix +module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1' +module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1' +module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1' +module.system.haste.paths.blacklist=.*/__tests__/.* +module.system.haste.paths.blacklist=.*/__mocks__/.* +module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.* +module.system.haste.paths.whitelist=/node_modules/react-native/Libraries/.* munge_underscores=true