Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2021-08-02 08:58:52 +00:00
parent 1c369971ff
commit 9b3d4fd580
9 changed files with 58 additions and 18 deletions

View file

@ -156,6 +156,9 @@ function calculateStatsPerFile(messages) {
return messages.reduce((stat, message) => {
if (message.fatal || message.severity === 2) {
stat.errorCount++;
if (message.fatal) {
stat.fatalErrorCount++;
}
if (message.fix) {
stat.fixableErrorCount++;
}
@ -168,6 +171,7 @@ function calculateStatsPerFile(messages) {
return stat;
}, {
errorCount: 0,
fatalErrorCount: 0,
warningCount: 0,
fixableErrorCount: 0,
fixableWarningCount: 0
@ -183,12 +187,14 @@ function calculateStatsPerFile(messages) {
function calculateStatsPerRun(results) {
return results.reduce((stat, result) => {
stat.errorCount += result.errorCount;
stat.fatalErrorCount += result.fatalErrorCount;
stat.warningCount += result.warningCount;
stat.fixableErrorCount += result.fixableErrorCount;
stat.fixableWarningCount += result.fixableWarningCount;
return stat;
}, {
errorCount: 0,
fatalErrorCount: 0,
warningCount: 0,
fixableErrorCount: 0,
fixableWarningCount: 0

13
node_modules/eslint/lib/cli.js generated vendored
View file

@ -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;
}

6
node_modules/eslint/lib/options.js generated vendored
View file

@ -290,6 +290,12 @@ module.exports = optionator({
default: "true",
description: "Prevent errors when pattern is unmatched"
},
{
option: "exit-on-fatal-error",
type: "Boolean",
default: "false",
description: "Exit with exit code 2 in case of fatal error"
},
{
option: "debug",
type: "Boolean",

View file

@ -216,6 +216,8 @@ module.exports = {
previousItemToken = tokenAfterItem
? sourceCode.getTokenBefore(tokenAfterItem)
: sourceCode.ast.tokens[sourceCode.ast.tokens.length - 1];
} else {
previousItemToken = currentItemToken;
}
});

View file

@ -131,15 +131,6 @@ module.exports = {
return token.value === "else" && token.type === "Keyword";
}
/**
* Gets the `else` keyword token of a given `IfStatement` node.
* @param {ASTNode} node A `IfStatement` node to get.
* @returns {Token} The `else` keyword token.
*/
function getElseKeyword(node) {
return node.alternate && sourceCode.getFirstTokenBetween(node.consequent, node.alternate, isElseKeywordToken);
}
/**
* Determines whether the given node has an `else` keyword token as the first token after.
* @param {ASTNode} node The node to check.
@ -361,7 +352,7 @@ module.exports = {
if (this.expected) {
context.report({
node,
loc: (name !== "else" ? node : getElseKeyword(node)).loc.start,
loc: body.loc,
messageId: opts && opts.condition ? "missingCurlyAfterCondition" : "missingCurlyAfter",
data: {
name
@ -371,7 +362,7 @@ module.exports = {
} else {
context.report({
node,
loc: (name !== "else" ? node : getElseKeyword(node)).loc.start,
loc: body.loc,
messageId: opts && opts.condition ? "unexpectedCurlyAfterCondition" : "unexpectedCurlyAfter",
data: {
name