From ff9f0bf49f4e501ebacf61d9694b80ab25f15f19 Mon Sep 17 00:00:00 2001 From: Sam Chen Date: Thu, 6 Aug 2020 01:10:24 +0800 Subject: [PATCH] clean formatMessage usage (#9059) --- packages/react-dev-utils/formatWebpackMessages.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/react-dev-utils/formatWebpackMessages.js b/packages/react-dev-utils/formatWebpackMessages.js index a49718d8eee..68afa222817 100644 --- a/packages/react-dev-utils/formatWebpackMessages.js +++ b/packages/react-dev-utils/formatWebpackMessages.js @@ -106,12 +106,8 @@ function formatMessage(message) { } function formatWebpackMessages(json) { - const formattedErrors = json.errors.map(function (message) { - return formatMessage(message, true); - }); - const formattedWarnings = json.warnings.map(function (message) { - return formatMessage(message, false); - }); + const formattedErrors = json.errors.map(formatMessage); + const formattedWarnings = json.warnings.map(formatMessage); const result = { errors: formattedErrors, warnings: formattedWarnings }; if (result.errors.some(isLikelyASyntaxError)) { // If there are any syntax errors, show just them.