Skip to content

Commit

Permalink
clean formatMessage usage (facebook#9059)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxsan authored and abhiisheek committed May 19, 2023
1 parent eaf7059 commit 10b4198
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/react-dev-utils/formatWebpackMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 10b4198

Please sign in to comment.