Update checked-in dependencies
This commit is contained in:
parent
1c369971ff
commit
9b3d4fd580
9 changed files with 58 additions and 18 deletions
13
node_modules/eslint/lib/cli.js
generated
vendored
13
node_modules/eslint/lib/cli.js
generated
vendored
|
|
@ -131,14 +131,16 @@ function translateOptions({
|
|||
*/
|
||||
function countErrors(results) {
|
||||
let errorCount = 0;
|
||||
let fatalErrorCount = 0;
|
||||
let warningCount = 0;
|
||||
|
||||
for (const result of results) {
|
||||
errorCount += result.errorCount;
|
||||
fatalErrorCount += result.fatalErrorCount;
|
||||
warningCount += result.warningCount;
|
||||
}
|
||||
|
||||
return { errorCount, warningCount };
|
||||
return { errorCount, fatalErrorCount, warningCount };
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -314,9 +316,12 @@ const cli = {
|
|||
if (await printResults(engine, resultsToPrint, options.format, options.outputFile)) {
|
||||
|
||||
// Errors and warnings from the original unfiltered results should determine the exit code
|
||||
const { errorCount, warningCount } = countErrors(results);
|
||||
const { errorCount, fatalErrorCount, warningCount } = countErrors(results);
|
||||
|
||||
const tooManyWarnings =
|
||||
options.maxWarnings >= 0 && warningCount > options.maxWarnings;
|
||||
const shouldExitForFatalErrors =
|
||||
options.exitOnFatalError && fatalErrorCount > 0;
|
||||
|
||||
if (!errorCount && tooManyWarnings) {
|
||||
log.error(
|
||||
|
|
@ -325,6 +330,10 @@ const cli = {
|
|||
);
|
||||
}
|
||||
|
||||
if (shouldExitForFatalErrors) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
return (errorCount || tooManyWarnings) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue