Skip to content

Commit

Permalink
fix(@angular/cli): fix ng lint formatted output (#4917)
Browse files Browse the repository at this point in the history
Print linting result only for human-readable formats, to not mess up xml, json, ... output.
  • Loading branch information
moritz-h authored and hansl committed Feb 22, 2017
1 parent 4af7a42 commit 0d8799e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/@angular/cli/tasks/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ export default Task.extend({
results = results.concat(result.output.trim().concat('\n'));
});

// print formatter output directly for non human-readable formats
if (['prose', 'verbose', 'stylish'].indexOf(commandOptions.format) == -1) {
ui.writeLine(results.trim());
return (errors == 0 || commandOptions.force) ? Promise.resolve(0) : Promise.resolve(2);
}

if (errors > 0) {
ui.writeLine(results.trim());
ui.writeLine(chalk.red('Lint errors found in the listed files.'));
Expand Down

0 comments on commit 0d8799e

Please sign in to comment.