Skip to content

Commit 574496d

Browse files
committed
fix(@angular/cli): fix ng lint formatted output
Print linting result only for human-readable formats, to not mess up xml, json, ... output. Fix angular#4791
1 parent b521ae5 commit 574496d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/@angular/cli/tasks/lint.ts

+6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ export default Task.extend({
6161
results = results.concat(result.output.trim().concat('\n'));
6262
});
6363

64+
// print formatter output directly for non human-readable formats
65+
if (['prose', 'verbose'].indexOf(commandOptions.format) == -1) {
66+
ui.writeLine(results.trim());
67+
return (errors == 0 || commandOptions.force) ? Promise.resolve(0) : Promise.resolve(2);
68+
}
69+
6470
if (errors > 0) {
6571
ui.writeLine(results.trim());
6672
ui.writeLine(chalk.red('Lint errors found in the listed files.'));

0 commit comments

Comments
 (0)