mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
10
tools/node_modules/eslint/README.md
generated
vendored
10
tools/node_modules/eslint/README.md
generated
vendored
@@ -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
|
||||
|
||||
6
tools/node_modules/eslint/lib/cli-engine/cli-engine.js
generated
vendored
6
tools/node_modules/eslint/lib/cli-engine/cli-engine.js
generated
vendored
@@ -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
13
tools/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;
|
||||
}
|
||||
|
||||
|
||||
6
tools/node_modules/eslint/lib/options.js
generated
vendored
6
tools/node_modules/eslint/lib/options.js
generated
vendored
@@ -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",
|
||||
|
||||
2
tools/node_modules/eslint/lib/rules/comma-style.js
generated
vendored
2
tools/node_modules/eslint/lib/rules/comma-style.js
generated
vendored
@@ -216,6 +216,8 @@ module.exports = {
|
||||
previousItemToken = tokenAfterItem
|
||||
? sourceCode.getTokenBefore(tokenAfterItem)
|
||||
: sourceCode.ast.tokens[sourceCode.ast.tokens.length - 1];
|
||||
} else {
|
||||
previousItemToken = currentItemToken;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
13
tools/node_modules/eslint/lib/rules/curly.js
generated
vendored
13
tools/node_modules/eslint/lib/rules/curly.js
generated
vendored
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
2
tools/node_modules/eslint/node_modules/chalk/package.json
generated
vendored
2
tools/node_modules/eslint/node_modules/chalk/package.json
generated
vendored
@@ -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",
|
||||
|
||||
8
tools/node_modules/eslint/node_modules/chalk/readme.md
generated
vendored
8
tools/node_modules/eslint/node_modules/chalk/readme.md
generated
vendored
@@ -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>
|
||||
|
||||
|
||||
2
tools/node_modules/eslint/node_modules/flatted/package.json
generated
vendored
2
tools/node_modules/eslint/node_modules/flatted/package.json
generated
vendored
@@ -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",
|
||||
|
||||
4
tools/node_modules/eslint/package.json
generated
vendored
4
tools/node_modules/eslint/package.json
generated
vendored
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user