Skip to content
Browse files

Fix incorrect `module.name_mapper` in template .flowconfig (#26330)

Has explained in #26233, current template is incorrect & can create error, like having require() of png that are considered as `string` instead of `number. This can probably hide tons of similar mistakes.

The change in this PR should resolve the previous behavior (& for example, some places in previous version of the flowconfig have the full path like here

Closes #26233

## Changelog

[General] [Fixed] Fix incorrect `module.name_mapper` in template .flowconfig

Alternatively, message could be

[General] [Internal] Fix incorrect `module.name_mapper` in template .flowconfig

As it hasn't this "bug" hasn't been released in a public stable release. You decide
Pull Request resolved: #26330

Test Plan: I just tested this in my project, thymikee might be able to confirm & approve this PR.

Differential Revision: D17258891

Pulled By: cpojer

fbshipit-source-id: 3904ffbc6f076ee0e435311249d694b8604fc7b8
  • Loading branch information...
MoOx authored and grabbou committed Sep 9, 2019
1 parent 231581c commit cf5ca2659a37942bc024c23ff30ef44844190d2a
Showing with 3 additions and 3 deletions.
  1. +3 −3 template/_flowconfig
@@ -36,9 +36,9 @@ module.file_ext=.ios.js


module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/Libraries/react-native/react-native-implementation'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/\1'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/Libraries/Image/RelativeImageStub'
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'


0 comments on commit cf5ca26

Please sign in to comment.
You can’t perform that action at this time.