fix @typescript-eslint/ban-ts-comment issues

This commit is contained in:
joshunrau 2024-08-29 11:47:42 -04:00
parent 5eaff6cb28
commit 148409bf20
3 changed files with 4 additions and 15 deletions

View File

@ -30,7 +30,7 @@ describe("ProgressBar", () => {
it("errors if an invalid progress value is provided", () => {
expect(() => {
// @ts-expect-error
// @ts-expect-error - progressBar.progress is typed as a a number, but should handle the case of a string
progressBar.progress = "0";
}).toThrowErrorMatchingInlineSnapshot(
'"jsPsych.progressBar.progress must be a number between 0 and 1"'

View File

@ -3,17 +3,6 @@
import { JsPsych } from "./JsPsych";
import { MigrationError } from "./migration";
// temporary patch for Safari
if (
typeof window !== "undefined" &&
Object.hasOwn(window, "webkitAudioContext") &&
!Object.hasOwn(window, "AudioContext")
) {
// @ts-expect-error
window.AudioContext = webkitAudioContext;
}
// end patch
// The following function provides a uniform interface to initialize jsPsych, no matter whether a
// browser supports ES6 classes or not (and whether the ES6 build or the Babel build is used).
/**

View File

@ -127,11 +127,11 @@ export class JsPsychData {
},
fullscreenchange: () => {
this.addInteractionRecord(
// @ts-expect-error
// @ts-expect-error - legacy code
document.isFullScreen ||
// @ts-expect-error
// @ts-expect-error - legacy code
document.webkitIsFullScreen ||
// @ts-expect-error
// @ts-expect-error - legacy code
document.mozIsFullScreen ||
document.fullscreenElement
? "fullscreenenter"