Skip to content

Commit 732ded7

Browse files
authored
[General] [Fixed] Fix incorrect module.name_mapper in template .flowconfig
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 https://github.com/facebook/react-native/blob/35300147ca66677f42e8544264be72ac0e9d1b45/template/_flowconfig#L61) Closes #26233 Alternatively, message could be ``` [General] [Fixed] 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
1 parent bf01dfb commit 732ded7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

template/_flowconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ module.file_ext=.ios.js
3636

3737
munge_underscores=true
3838

39-
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/Libraries/react-native/react-native-implementation'
40-
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/\1'
41-
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'
39+
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
40+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
41+
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'
4242

4343
suppress_type=$FlowIssue
4444
suppress_type=$FlowFixMe

0 commit comments

Comments
 (0)