From e121fee5a2176257a256f67d1fb991636d213243 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Tue, 22 Aug 2023 16:00:39 -0700 Subject: [PATCH] Fix react-native name_mapper flowconfig (#39119) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39119 The current mapping will map `react-native/foo/bar` to `/path/to/project/root/packages/react-nativefoo/bar`, which is totally incorrect. How things still type check despite this bad config is a mystery, but at least now it's fixed Changelog: [Internal] Reviewed By: samwgoldman Differential Revision: D48581370 fbshipit-source-id: b4bf8e76b255ffa5c44817ce587bdc8e68b62037 --- .flowconfig | 2 +- .flowconfig.android | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.flowconfig b/.flowconfig index 9541e53e0b8..729373a320b 100644 --- a/.flowconfig +++ b/.flowconfig @@ -46,7 +46,7 @@ module.file_ext=.ios.js munge_underscores=true module.name_mapper='^react-native$' -> '/packages/react-native/index.js' -module.name_mapper='^react-native/\(.*\)$' -> '/packages/react-native\1' +module.name_mapper='^react-native/\(.*\)$' -> '/packages/react-native/\1' module.name_mapper='^@react-native/dev-middleware$' -> '/packages/dev-middleware' 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\)$' -> '/packages/react-native/Libraries/Image/RelativeImageStub' diff --git a/.flowconfig.android b/.flowconfig.android index 4d303d65022..764825761bf 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -46,7 +46,7 @@ module.file_ext=.android.js munge_underscores=true module.name_mapper='^react-native$' -> '/packages/react-native/index.js' -module.name_mapper='^react-native/\(.*\)$' -> '/packages/react-native\1' +module.name_mapper='^react-native/\(.*\)$' -> '/packages/react-native/\1' module.name_mapper='^@react-native/dev-middleware$' -> '/packages/dev-middleware' 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\)$' -> '/packages/react-native/Libraries/Image/RelativeImageStub'