Skip to content

Commit 578efad

Browse files
authored
Chore: update no-unused-vars caughtErrors in eslint-config-eslint (#13351)
1 parent 426088c commit 578efad

20 files changed

Lines changed: 30 additions & 30 deletions

lib/cli-engine/cli-engine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ function getCacheFile(cacheFile, cwd) {
403403

404404
try {
405405
fileStats = fs.lstatSync(resolvedCacheFile);
406-
} catch (ex) {
406+
} catch {
407407
fileStats = null;
408408
}
409409

@@ -991,7 +991,7 @@ class CLIEngine {
991991
const npmFormat = naming.normalizePackageName(normalizedFormatName, "eslint-formatter");
992992

993993
formatterPath = ModuleResolver.resolve(npmFormat, path.join(cwd, "__placeholder__.js"));
994-
} catch (e) {
994+
} catch {
995995
formatterPath = path.resolve(__dirname, "formatters", normalizedFormatName);
996996
}
997997
}

lib/cli-engine/config-array-factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ class ConfigArrayFactory {
517517
try {
518518
loadPackageJSONConfigFile(filePath);
519519
return filePath;
520-
} catch (error) { /* ignore */ }
520+
} catch { /* ignore */ }
521521
} else {
522522
return filePath;
523523
}

lib/init/config-initializer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function getLocalESLintVersion() {
350350
const eslint = require(eslintPath);
351351

352352
return eslint.linter.version || null;
353-
} catch (_err) {
353+
} catch {
354354
return null;
355355
}
356356
}

lib/linter/config-comment-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module.exports = class ConfigCommentParser {
7878
config: items
7979
};
8080
}
81-
} catch (ex) {
81+
} catch {
8282

8383
debug("Levn parsing failed; falling back to manual parsing.");
8484

lib/rules/no-control-regex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const collector = new (class {
3535
try {
3636
this._source = regexpStr;
3737
this._validator.validatePattern(regexpStr); // Call onCharacter hook
38-
} catch (err) {
38+
} catch {
3939

4040
// Ignore syntax errors in RegExp.
4141
}

lib/rules/no-invalid-regexp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ module.exports = {
9393
try {
9494
validator.validateFlags(flags);
9595
return null;
96-
} catch (err) {
96+
} catch {
9797
return `Invalid flags supplied to RegExp constructor '${flags}'`;
9898
}
9999
}

lib/rules/no-misleading-character-class.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ module.exports = {
147147
pattern.length,
148148
flags.includes("u")
149149
);
150-
} catch (e) {
150+
} catch {
151151

152152
// Ignore regular expressions with syntax errors
153153
return;

lib/rules/no-regex-spaces.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module.exports = {
7676

7777
try {
7878
regExpAST = regExpParser.parsePattern(pattern, 0, pattern.length, flags.includes("u"));
79-
} catch (e) {
79+
} catch {
8080

8181
// Ignore regular expressions with syntax errors
8282
return;

lib/rules/no-useless-backreference.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module.exports = {
9595

9696
try {
9797
regExpAST = parser.parsePattern(pattern, 0, pattern.length, flags.includes("u"));
98-
} catch (e) {
98+
} catch {
9999

100100
// Ignore regular expressions with syntax errors
101101
return;

lib/rules/prefer-named-capture-group.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module.exports = {
5959

6060
try {
6161
ast = parser.parsePattern(pattern, 0, pattern.length, uFlag);
62-
} catch (_) {
62+
} catch {
6363

6464
// ignore regex syntax errors
6565
return;

0 commit comments

Comments
 (0)