Commit 21349c54 authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Tweak error and warning output (#2152)

* Tweak error and warning output

* Add a colon
parent 77087da3
3 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file
Showing with 23 additions and 10 deletions
+23 -10
......@@ -37,7 +37,7 @@ function formatter(results) {
position,
messageType,
message.message.replace(/\.$/, ''),
chalk.dim(message.ruleId || ''),
chalk.cyan(message.ruleId || ''),
];
});
......
......@@ -86,9 +86,17 @@ function formatMessage(message, isError) {
);
}
// Prepend filename with an explanation.
lines[0] = chalk.underline(lines[0]) +
(isError ? ' contains errors.' : ' contains warnings.');
// Make filename nicer.
var slashIndex = Math.max(
lines[0].lastIndexOf('/'),
lines[0].lastIndexOf('\\')
);
var fileName = lines[0].substring(slashIndex + 1);
var path = lines[0].substring(0, slashIndex + 1);
lines[0] = chalk.dim(isError ? 'Found errors in ' : 'Found warnings in ') +
path +
(isError ? chalk.red : chalk.yellow)(fileName) +
chalk.dim(':');
// Reassemble the message.
message = lines.join('\n');
......
......@@ -103,15 +103,20 @@ module.exports = function createWebpackCompiler(config, onReadyCallback) {
// Teach some ESLint tricks.
console.log(
'Search the ' +
chalk.dim('keywords') +
' from the right column to learn more.'
chalk.dim(
'Search for the ' +
chalk.cyan('rule keywords') +
' to learn more about each warning.'
)
);
console.log(
'To ignore, add ' +
chalk.yellow('// eslint-disable-next-line') +
' to the line before.'
chalk.dim(
'To ignore, add ' +
chalk.yellow('// eslint-disable-next-line') +
' to the previous line.'
)
);
console.log();
}
});
......
Supports Markdown
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