Skip to content

Commit bb24ca8

Browse files
build(dev-deps): upgrade eslint from v8 to v9 (#5559)
* build(dev-deps): upgrade `eslint` from v8 to v9 Signed-off-by: hainenber <dotronghai96@gmail.com> * chore: remove newline in helpers.js * chore: remove ignored caught error and related eslint directive Signed-off-by: hainenber <dotronghai96@gmail.com> * chore: restore lockfile to v2 Signed-off-by: hainenber <dotronghai96@gmail.com> --------- Signed-off-by: hainenber <dotronghai96@gmail.com> Co-authored-by: Mark Wiemer <7833360+mark-wiemer@users.noreply.github.com>
1 parent cafa782 commit bb24ca8

File tree

21 files changed

+583
-329
lines changed

21 files changed

+583
-329
lines changed

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const createBundleDir = (cfg, bundleDirPath) => {
151151
bundleDirPath,
152152
},
153153
};
154-
} catch (ignored) {
154+
} catch {
155155
console.error(
156156
`Failed to create ${bundleDirPath}; using temp directory instead`,
157157
);

lib/cli/lookup-files.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ module.exports = function lookupFiles(
112112
if (stat.isFile() || stat.isFIFO()) {
113113
return filepath;
114114
}
115-
} catch (err) {
115+
} catch {
116116
// ignore error
117117
return;
118118
}
@@ -130,7 +130,7 @@ module.exports = function lookupFiles(
130130
}
131131
return;
132132
}
133-
} catch (ignored) {
133+
} catch {
134134
return;
135135
}
136136
if (!extensions.length) {

lib/errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ function createMultipleDoneError(runnable, originalErr) {
299299
if (runnable.parent.root) {
300300
title += " (of root suite)";
301301
}
302-
} catch (ignored) {
302+
} catch {
303303
title = format("<%s> (of unknown suite)", runnable.title);
304304
}
305305
var message = format(

lib/mocha.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ Mocha.prototype.ui = function (ui) {
358358
if (!bindInterface) {
359359
try {
360360
bindInterface = require(ui);
361-
} catch (err) {
361+
} catch {
362362
throw createInvalidInterfaceError(`invalid interface '${ui}'`, ui);
363363
}
364364
}

lib/nodejs/worker.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ async function run(filepath, serializedOptions = "{}") {
8383
}
8484
let argv;
8585
try {
86-
// eslint-disable-next-line no-eval
8786
argv = eval("(" + serializedOptions + ")");
88-
} catch (err) {
87+
} catch {
8988
throw createInvalidArgumentValueError(
9089
"run() was unable to deserialize the options",
9190
"serializedOptions",

lib/reporters/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ var generateDiff = (exports.generateDiff = function (actual, expected) {
217217
result = `${result}\n [mocha] output truncated to ${maxLen} characters, see "maxDiffSize" reporter-option\n`;
218218
}
219219
return result;
220-
} catch (err) {
220+
} catch {
221221
var msg =
222222
"\n " +
223223
color("diff added", "+ expected") +

lib/runner.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,8 @@ Runner.prototype.fail = function (test, err, force) {
495495

496496
try {
497497
currentErr.stack = stackFilter(currentErr.stack);
498-
} catch (ignore) {
499-
// some environments do not take kindly to monkeying with the stack
498+
} catch {
499+
// Ignore error as some environments do not take kindly to monkeying with the stack
500500
}
501501

502502
currentErr = currentErr.cause;

lib/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ function jsonStringify(object, spaces, depth) {
362362
*/
363363
exports.canonicalize = function canonicalize(value, stack, typeHint) {
364364
var canonicalizedObj;
365-
/* eslint-disable no-unused-vars */
365+
366366
var prop;
367-
/* eslint-enable no-unused-vars */
367+
368368
typeHint = typeHint || canonicalType(value);
369369
function withStack(value, fn) {
370370
stack.push(value);
@@ -392,12 +392,12 @@ exports.canonicalize = function canonicalize(value, stack, typeHint) {
392392
});
393393
break;
394394
case "function":
395-
/* eslint-disable-next-line no-unused-vars, no-unreachable-loop */
395+
/* eslint-disable-next-line no-unused-vars */
396396
for (prop in value) {
397397
canonicalizedObj = {};
398398
break;
399399
}
400-
/* eslint-enable guard-for-in */
400+
401401
if (!canonicalizedObj) {
402402
canonicalizedObj = emptyRepresentation(value, typeHint);
403403
break;

0 commit comments

Comments
 (0)