From 98546e9b19bfde2d8cf4f4330d2b96b44234eb21 Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Thu, 22 Nov 2018 12:24:55 -0800 Subject: [PATCH] Use real flow types from metro Summary: Stop ignoring `metro` folder from RN and use their flowtypes correctly Reviewed By: hramos Differential Revision: D13085169 fbshipit-source-id: f285223afb7e89ac2c63e53d36be2f3645fa6761 --- .flowconfig | 3 -- .flowconfig.android | 3 -- flow-github/metro.js | 68 ++------------------------------------------ 3 files changed, 3 insertions(+), 71 deletions(-) diff --git a/.flowconfig b/.flowconfig index 41bc5c5778cd1c..e3c0deb8e59feb 100644 --- a/.flowconfig +++ b/.flowconfig @@ -22,9 +22,6 @@ ; Ignore polyfills .*/Libraries/polyfills/.* -; Ignore metro -.*/node_modules/metro/.* - ; These should not be required directly ; require from fbjs/lib instead: require('fbjs/lib/invariant') .*/node_modules/invariant/.* diff --git a/.flowconfig.android b/.flowconfig.android index 4f106740f516da..0f70fa4dd7a2bf 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -22,9 +22,6 @@ ; Ignore polyfills .*/Libraries/polyfills/.* -; Ignore metro -.*/node_modules/metro/.* - ; These should not be required directly ; require from fbjs/lib instead: require('fbjs/lib/invariant') .*/node_modules/invariant/.* diff --git a/flow-github/metro.js b/flow-github/metro.js index bb67ab543d5363..68d0af715a1488 100644 --- a/flow-github/metro.js +++ b/flow-github/metro.js @@ -8,70 +8,8 @@ * @format */ -declare module 'metro' { - declare module.exports: any; -} - -declare module 'metro/src/HmrServer' { - declare module.exports: any; -} - -declare module 'metro/src/lib/attachWebsocketServer' { - declare module.exports: any; -} - -declare module 'metro/src/lib/bundle-modules/HMRClient' { - declare module.exports: any; -} - -declare module 'metro/src/lib/TerminalReporter' { - declare module.exports: any; -} - -declare module 'metro/src/Bundler' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/types.flow.js' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/types.flow.js' { - declare module.exports: any; -} - -declare module 'metro/src/lib/getMaxWorkers' { - declare module.exports: any; -} - -declare module 'metro/src/lib/createModuleIdFactory' { - declare module.exports: any; -} - -declare module 'metro/src/shared/types.flow' { - declare module.exports: any; -} - -declare module 'metro/src/lib/reporting' { - declare module.exports: any; -} - -declare module 'metro/src/Server' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/worker/collectDependencies' { - declare module.exports: any; -} - -declare module 'metro/src/JSTransformer/worker' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/plainJSBundle' { +// metro-visualizer is not listed as a dependency of metro since it pulls a lot +// of transitive dependencies so we need to tell flow that it may exist. +declare module 'metro-visualizer' { declare module.exports: any; }