Updated to eslint 9

This isn't officially compatible with the oldest version of Node that
Jasmine supports, but it works. If it stops working, we can always disable
linting in CI builds on older Node versions.
This commit is contained in:
Steve Gravrock
2025-04-07 21:08:29 -07:00
parent 7b2ab822c6
commit 5ff7e7f9a1
20 changed files with 80 additions and 36 deletions

View File

@@ -36,6 +36,7 @@ getJasmineRequireObj().Deprecator = function(j$) {
Deprecator.prototype.log_ = function(runnable, deprecation, options) {
if (j$.isError_(deprecation)) {
// eslint-disable-next-line no-console
console.error(deprecation);
return;
}
@@ -58,6 +59,7 @@ getJasmineRequireObj().Deprecator = function(j$) {
context += '\n' + verboseNote;
}
// eslint-disable-next-line no-console
console.error('DEPRECATION: ' + deprecation + context);
};

View File

@@ -385,7 +385,9 @@ getJasmineRequireObj().Env = function(j$) {
// If we get here, all results have been reported and there's nothing we
// can do except log the result and hope the user sees it.
// eslint-disable-next-line no-console
console.error('Jasmine received a result after the suite finished:');
// eslint-disable-next-line no-console
console.error(expectationResult);
}

View File

@@ -58,6 +58,7 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
) {
try {
this.emitScalar(value.toString());
// eslint-disable-next-line no-unused-vars
} catch (e) {
this.emitScalar('has-invalid-toString-method');
}
@@ -304,6 +305,7 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
value.toString !== Object.prototype.toString &&
value.toString() !== Object.prototype.toString.call(value)
);
// eslint-disable-next-line no-unused-vars
} catch (e) {
// The custom toString() threw.
return true;

View File

@@ -22,6 +22,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
}
function fallbackOnMultipleDone() {
// eslint-disable-next-line no-console
console.error(
new Error(
"An asynchronous function called its 'done' " +
@@ -135,6 +136,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
// Any error we catch here is probably due to a bug in Jasmine,
// and it's not likely to end up anywhere useful if we let it
// propagate. Log it so it can at least show up when debugging.
// eslint-disable-next-line no-console
console.error(error);
}
}

View File

@@ -252,6 +252,7 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
let value;
try {
value = obj[prop];
// eslint-disable-next-line no-unused-vars
} catch (e) {
return false;
}

View File

@@ -31,6 +31,7 @@ getJasmineRequireObj().toBeInstanceOf = function(j$) {
try {
expectedMatcher = new j$.Any(expected);
pass = expectedMatcher.asymmetricMatch(actual);
// eslint-disable-next-line no-unused-vars
} catch (error) {
throw new Error(
usageError('Expected value is not a constructor function')