From 1b4c460bc7b07a9fc208bc468ced484cc4f5f05b Mon Sep 17 00:00:00 2001 From: Jing Chen Date: Mon, 24 Aug 2015 19:33:19 -0700 Subject: [PATCH] [react-native] Make flow warn on timeout instead of redbox --- getFlowTypeCheckMiddleware.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/getFlowTypeCheckMiddleware.js b/getFlowTypeCheckMiddleware.js index bc89b70a..f3481551 100644 --- a/getFlowTypeCheckMiddleware.js +++ b/getFlowTypeCheckMiddleware.js @@ -99,6 +99,13 @@ function doFlowTypecheck(res, flowroot, next) { hasWarned.noConfig = true; console.warn(chalk.yellow('flow: ' + stderr)); } + _endFlowBad(res); + } else if (flowError.code === 3) { + if (!hasWarned.timeout) { + hasWarned.timeout = true; + console.warn(chalk.yellow('flow: ' + stdout)); + } + _endSkipFlow(res); } else { if (!hasWarned.brokenFlow) { hasWarned.brokenFlow = true; @@ -107,8 +114,8 @@ function doFlowTypecheck(res, flowroot, next) { '`.\n' + 'stderr: `' + stderr + '`' )); } + _endFlowBad(res); } - _endFlowBad(res); return; } }