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

Omit ESLint warnings when there are ESLint errors (#2120)

parent 8d4604eb
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 13 additions and 1 deletion
+13 -1
......@@ -84,7 +84,7 @@ function formatMessage(message, isError) {
"$1 '$4' does not contain an export named '$3'."
);
}
// TODO: Ideally we should write a custom ESLint formatter instead.
// If the second line already includes a filename, and it's a warning,
......@@ -122,6 +122,18 @@ function formatMessage(message, isError) {
return true;
});
var ESLINT_WARNING_LABEL = String.fromCharCode(27) +
'[33m' +
'warning' +
String.fromCharCode(27) +
'[39m';
// If there were errors, omit any warnings.
if (isError) {
lines = lines.filter(function(line) {
return line.indexOf(ESLINT_WARNING_LABEL) === -1;
});
}
// Prepend filename with an explanation.
lines[0] =
// Underline
......
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