Skip to content

Commit 8e93875

Browse files
committed
filter warnings in toJson to also filter output for --json flag
1 parent a903e6b commit 8e93875

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

‎lib/Stats.js‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ class Stats {
184184

185185
const obj = {
186186
errors: compilation.errors.map(formatError),
187-
warnings: compilation.warnings.map(formatError),
188-
warningsFilter: warningsFilter,
187+
warnings: Stats.filterWarnings(compilation.warnings.map(formatError), warningsFilter)
189188
};
190189

191190
//We just hint other renderers since actually omitting
@@ -790,12 +789,11 @@ class Stats {
790789
}
791790

792791
if(obj._showWarnings && obj.warnings) {
793-
Stats.filterWarnings(obj.warnings, obj.warningsFilter)
794-
.forEach(warning => {
795-
newline();
796-
colors.yellow(`WARNING in ${warning}`);
797-
newline();
798-
});
792+
obj.warnings.forEach(warning => {
793+
newline();
794+
colors.yellow(`WARNING in ${warning}`);
795+
newline();
796+
});
799797
}
800798
if(obj._showErrors && obj.errors) {
801799
obj.errors.forEach(error => {

0 commit comments

Comments
 (0)