Skip to content

Commit

Permalink
flow: Update .flowconfig
Browse files Browse the repository at this point in the history
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:
facebook/react-native@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:
facebook/flow@ca4a3d9
  • Loading branch information
borisyankov committed Oct 4, 2018
1 parent 99f2d5f commit 43fe0d3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*

munge_underscores=true

Expand Down

0 comments on commit 43fe0d3

Please sign in to comment.