You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flow: Simplify module.name_mapper types/ entry by generalizing
As we move more and more modules into `.js.flow` files in this tree,
I wondered if we could avoid having to keep making this line longer
and longer to enumerate them.
Happily it seems we can! I tested like so:
* Flow passes.
* If I edit something in `types/` in a way that should break a use
site in `src/`, I correctly get an error.
* Same if I instead edit something in `node_modules/react-native/`,
something we import directly from some path `react-native/…` --
the case covered by another of these `module.name_mapper` lines.
(I used the EditingEvent type imported by our SearchMessagesScreen
et al.)
* Same if I instead edit something in `node_modules` that has its
own Flow types. (I used `@react-native-community/cameraroll`,
imported by our `src/lightbox/download.js`.)
* Same if I instead edit something in `flow-typed/`.
So Flow is successfully finding definitions in `types/` when that's
where the module exists, and successfully finding them elsewhere
when not -- whether that be through a different `name_mapper` line,
or through the `node_modules/` search, or in a libdef in `flow-typed/`.
0 commit comments