tools: update ESLint to 7.32.0

PR-URL: https://github.com/nodejs/node/pull/39602
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
This commit is contained in:
Luigi Pinca
2021-07-31 08:18:34 +02:00
parent 0f9434af4d
commit 296354950c
11 changed files with 49 additions and 19 deletions

10
tools/node_modules/eslint/README.md generated vendored
View File

@@ -254,6 +254,16 @@ Toru Nagashima
The people who review and fix bugs and help triage issues.
<table><tbody><tr><td align="center" valign="top" width="11%">
<a href="https://github.com/brettz9">
<img src="https://github.com/brettz9.png?s=75" width="75" height="75"><br />
Brett Zamir
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/bmish">
<img src="https://github.com/bmish.png?s=75" width="75" height="75"><br />
Bryan Mishkin
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/g-plane">
<img src="https://github.com/g-plane.png?s=75" width="75" height="75"><br />
Pig Fang

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
tools/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;
}

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

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/helper-validator-identifier",
"version": "7.14.5",
"version": "7.14.8",
"description": "Validate identifier/keywords name",
"repository": {
"type": "git",

View File

@@ -1,6 +1,6 @@
{
"name": "chalk",
"version": "4.1.1",
"version": "4.1.2",
"description": "Terminal string styling done right",
"license": "MIT",
"repository": "chalk/chalk",

View File

@@ -33,7 +33,7 @@
<br>
<br>
<a href="https://retool.com/?utm_campaign=sindresorhus">
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="210"/>
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230"/>
</a>
<br>
<br>
@@ -48,6 +48,12 @@
<span>and avoiding access controls. Keep your team and servers in sync with Doppler.</span>
</div>
</a>
<br>
<a href="https://uibakery.io/?utm_source=chalk&utm_medium=sponsor&utm_campaign=github">
<div>
<img src="https://sindresorhus.com/assets/thanks/uibakery-logo.jpg" width="270" alt="UI Bakery">
</div>
</a>
</p>
</div>

View File

@@ -1,6 +1,6 @@
{
"name": "flatted",
"version": "3.2.1",
"version": "3.2.2",
"description": "A super light and fast circular JSON parser.",
"unpkg": "min.js",
"types": "types.d.ts",

View File

@@ -1,6 +1,6 @@
{
"name": "eslint",
"version": "7.31.0",
"version": "7.32.0",
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
"description": "An AST-based pattern checker for JavaScript.",
"bin": {
@@ -96,7 +96,7 @@
"ejs": "^3.0.2",
"eslint": "file:.",
"eslint-config-eslint": "file:packages/eslint-config-eslint",
"eslint-plugin-eslint-plugin": "^3.2.0",
"eslint-plugin-eslint-plugin": "^3.5.3",
"eslint-plugin-internal-rules": "file:tools/internal-rules",
"eslint-plugin-jsdoc": "^25.4.3",
"eslint-plugin-node": "^11.1.0",