Commit 0f801a93 authored by Philipp Nowinski's avatar Philipp Nowinski

[BUGFIX] fix output format

parent b7a05622
......@@ -25,7 +25,7 @@ module.exports = class LintingFormatter {
position = ' ' + position;
}
formattedMessage += `${chalk.white(position)} ${chalk.yellow('')} ${_message.message}` +
`${chalk.white(` (Violated rule ${chalk.italic(_message.ruleId)})`)}`;
`${chalk.white(` (Violated rule ${chalk.italic(_message.ruleId)})`)}\n`;
});
return formattedMessage;
}
......
......@@ -226,7 +226,12 @@ module.exports = class Css extends Task {
}
})
};
return `\n${LintingFormatter.format(error)}\n`;
let errorMessage = `${LintingFormatter.format(error)}`;
if (!this._printedError) {
errorMessage = `\n${errorMessage}`;
this._printedError = true;
}
return errorMessage;
}
})
]).process(file, {
......
......@@ -195,17 +195,16 @@ module.exports = class Js extends Task {
if (report.errorCount > 0) {
this._logger.displayNotification('SGC js:qa task', 'You have some linting-errors in your JavaScript. Please fix them!');
}
let foundError = 0;
let printedError = false;
report.results.forEach((_error) => {
if (_error.errorCount > 0 || _error.warningCount > 0) {
foundError = true;
console.log();
if (!printedError) {
console.log();
printedError = true;
}
console.log(LintingFormatter.format(_error));
}
});
if (foundError) {
console.log();
}
resolve();
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment