Skip to content

Commit 843a433

Browse files
elicwhitefacebook-github-bot
authored andcommitted
Update react-native init's flowconfig
Summary: Fixes #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
1 parent aaddbee commit 843a433

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

local-cli/templates/HelloWorld/_flowconfig

+13
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ node_modules/react-native/flow-github/
3030
emoji=true
3131

3232
module.system=haste
33+
module.system.haste.use_name_reducers=true
34+
# get basename
35+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
36+
# strip .js or .js.flow suffix
37+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
38+
# strip .ios suffix
39+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
40+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
41+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
42+
module.system.haste.paths.blacklist=.*/__tests__/.*
43+
module.system.haste.paths.blacklist=.*/__mocks__/.*
44+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
45+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
3346

3447
munge_underscores=true
3548

0 commit comments

Comments
 (0)