Skip to content

Commit

Permalink
Change console.log for errors and warnings (facebook#1375)
Browse files Browse the repository at this point in the history
Array.forEach is passed the following parameters:

currentValue
    The current element being processed in the array.
index
    The index of the current element being processed in the array.
array
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach

console.log takes multiple arguments. We only want to print the first one, the actually message.
  • Loading branch information
jimmyhmiller authored and randycoulman committed May 8, 2017
1 parent 83726a6 commit 4b4f772
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-dev-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ compiler.plugin('done', function(stats) {
}
if (messages.errors.length) {
console.log('Failed to compile.');
messages.errors.forEach(console.log);
messages.errors.forEach(e => console.log(e));
return;
}
if (messages.warnings.length) {
console.log('Compiled with warnings.');
messages.warnings.forEach(console.log);
messages.warnings.forEach(w => console.log(w));
}
});
```
Expand Down

0 comments on commit 4b4f772

Please sign in to comment.