Skip to content

Commit

Permalink
clean formatMessage usage (#9059)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxsan authored Aug 5, 2020
1 parent 2c2e224 commit ebab256
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 ebab256

Please sign in to comment.