From 43fe0d397868692c0ff40f27278ab9d369c8bb86 Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Fri, 21 Sep 2018 23:10:26 +0300 Subject: [PATCH] flow: Update .flowconfig Because of the removal of @providesModule in React Native 0.56 a confiuration in Flow was changed. Both the removal and the config is implemented in this PR: https://github.com/facebook/react-native/commit/d5e9e55fa It configures name reducers which are series of replacements that are applied in order to reduce a filename to a module id. For more information on haste name reducers here: https://github.com/facebook/flow/commit/ca4a3d9f4603f0636a6efa79cb222525d1a67497 --- .flowconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.flowconfig b/.flowconfig index 8e80a1299f5..d8b1948997c 100644 --- a/.flowconfig +++ b/.flowconfig @@ -59,6 +59,19 @@ emoji=true include_warnings=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