Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2023-10-09 17:38:29 +00:00
parent 5d6442e87d
commit 026e833827
36 changed files with 1972 additions and 643 deletions

View file

@ -594,9 +594,9 @@ function createIgnoreResult(filePath, baseDir) {
const isInNodeModules = baseDir && path.dirname(path.relative(baseDir, filePath)).split(path.sep).includes("node_modules");
if (isInNodeModules) {
message = "File ignored by default because it is located under the node_modules directory. Use ignore pattern \"!**/node_modules/\" to override.";
message = "File ignored by default because it is located under the node_modules directory. Use ignore pattern \"!**/node_modules/\" to disable file ignore settings or use \"--no-warn-ignored\" to suppress this warning.";
} else {
message = "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override.";
message = "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to disable file ignore settings or use \"--no-warn-ignored\" to suppress this warning.";
}
return {
@ -676,6 +676,7 @@ function processOptions({
overrideConfigFile = null,
plugins = {},
reportUnusedDisableDirectives = null, // ← should be null by default because if it's a string then it overrides the 'reportUnusedDisableDirectives' setting in config files. And we cannot use `overrideConfig.reportUnusedDisableDirectives` instead because we cannot configure the `error` severity with that.
warnIgnored = true,
...unknownOptions
}) {
const errors = [];
@ -781,6 +782,9 @@ function processOptions({
) {
errors.push("'reportUnusedDisableDirectives' must be any of \"error\", \"warn\", \"off\", and null.");
}
if (typeof warnIgnored !== "boolean") {
errors.push("'warnIgnored' must be a boolean.");
}
if (errors.length > 0) {
throw new ESLintInvalidOptionsError(errors);
}
@ -802,7 +806,8 @@ function processOptions({
globInputPaths,
ignore,
ignorePatterns,
reportUnusedDisableDirectives
reportUnusedDisableDirectives,
warnIgnored
};
}

View file

@ -84,6 +84,7 @@ const LintResultCache = require("../cli-engine/lint-result-cache");
* when a string.
* @property {Record<string,Plugin>} [plugins] An array of plugin implementations.
* @property {"error" | "warn" | "off"} [reportUnusedDisableDirectives] the severity to report unused eslint-disable directives.
* @property {boolean} warnIgnored Show warnings when the file list includes ignored files
*/
//------------------------------------------------------------------------------
@ -749,7 +750,8 @@ class FlatESLint {
fixTypes,
reportUnusedDisableDirectives,
globInputPaths,
errorOnUnmatchedPattern
errorOnUnmatchedPattern,
warnIgnored
} = eslintOptions;
const startTime = Date.now();
const fixTypesSet = fixTypes ? new Set(fixTypes) : null;
@ -795,7 +797,11 @@ class FlatESLint {
* pattern, then notify the user.
*/
if (ignored) {
return createIgnoreResult(filePath, cwd);
if (warnIgnored) {
return createIgnoreResult(filePath, cwd);
}
return void 0;
}
const config = configs.getConfig(filePath);
@ -908,7 +914,7 @@ class FlatESLint {
const {
filePath,
warnIgnored = false,
warnIgnored,
...unknownOptions
} = options || {};
@ -922,7 +928,7 @@ class FlatESLint {
throw new Error("'options.filePath' must be a non-empty string or undefined");
}
if (typeof warnIgnored !== "boolean") {
if (typeof warnIgnored !== "boolean" && typeof warnIgnored !== "undefined") {
throw new Error("'options.warnIgnored' must be a boolean or undefined");
}
@ -937,7 +943,8 @@ class FlatESLint {
allowInlineConfig,
cwd,
fix,
reportUnusedDisableDirectives
reportUnusedDisableDirectives,
warnIgnored: constructorWarnIgnored
} = eslintOptions;
const results = [];
const startTime = Date.now();
@ -945,7 +952,9 @@ class FlatESLint {
// Clear the last used config arrays.
if (resolvedFilename && await this.isPathIgnored(resolvedFilename)) {
if (warnIgnored) {
const shouldWarnIgnored = typeof warnIgnored === "boolean" ? warnIgnored : constructorWarnIgnored;
if (shouldWarnIgnored) {
results.push(createIgnoreResult(resolvedFilename, cwd));
}
} else {