From 0b05b3c2fdb7cfa67923388e1776c71ea410e422 Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 16 Apr 2025 19:15:30 +0200 Subject: [PATCH] refactor: enable ban-ts-comment rule --- backend/.oxlintrc.json | 3 ++- backend/src/services/weekly-xp-leaderboard.ts | 5 ++--- frontend/.oxlintrc.json | 3 ++- frontend/__tests__/setup-tests.ts | 4 ++-- frontend/src/ts/config.ts | 8 ++++---- frontend/src/ts/constants/env-config.ts | 10 +++++----- frontend/src/ts/controllers/ad-controller.ts | 14 +++++++------- .../src/ts/controllers/captcha-controller.ts | 6 +++--- frontend/src/ts/controllers/chart-controller.ts | 8 ++++---- frontend/src/ts/controllers/eg-ad-controller.ts | 10 +++++----- frontend/src/ts/controllers/input-controller.ts | 6 +++--- frontend/src/ts/controllers/page-controller.ts | 2 +- frontend/src/ts/controllers/pw-ad-controller.ts | 3 ++- frontend/src/ts/controllers/sound-controller.ts | 6 ++---- frontend/src/ts/firebase.ts | 3 ++- frontend/src/ts/index.ts | 2 +- frontend/src/ts/pages/account.ts | 4 ++-- frontend/src/ts/pages/leaderboards.ts | 2 +- frontend/src/ts/pages/settings.ts | 2 +- frontend/src/ts/popups/video-ad-popup.ts | 2 +- frontend/src/ts/ready.ts | 2 +- frontend/src/ts/test/test-logic.ts | 2 +- frontend/src/ts/test/test-stats.ts | 8 ++++---- frontend/src/ts/utils/config.ts | 16 ++++++++-------- frontend/src/ts/utils/date-and-time.ts | 4 ++-- frontend/src/ts/utils/misc.ts | 2 +- packages/oxlint-config/index.json | 5 ++--- 27 files changed, 71 insertions(+), 71 deletions(-) diff --git a/backend/.oxlintrc.json b/backend/.oxlintrc.json index ddb8ba15b..b36f88c5c 100644 --- a/backend/.oxlintrc.json +++ b/backend/.oxlintrc.json @@ -9,7 +9,8 @@ "plugins": ["jest", "vitest"], "rules": { "no-explicit-any": "allow", - "explicit-function-return-type": "off" + "explicit-function-return-type": "off", + "ban-ts-comment": "off" } } ] diff --git a/backend/src/services/weekly-xp-leaderboard.ts b/backend/src/services/weekly-xp-leaderboard.ts index 14ca15234..b02e04f94 100644 --- a/backend/src/services/weekly-xp-leaderboard.ts +++ b/backend/src/services/weekly-xp-leaderboard.ts @@ -196,8 +196,6 @@ export class WeeklyXpLeaderboard { // eslint-disable-next-line @typescript-eslint/no-unused-expressions connection.set; - // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error - // @ts-ignore const [[, rank], [, totalXp], [, _count], [, result]] = (await connection .multi() .zrevrank(weeklyXpLeaderboardScoresKey, uid) @@ -207,7 +205,8 @@ export class WeeklyXpLeaderboard { .exec()) as [ [null, number | null], [null, string | null], - [null, number | null] + [null, number | null], + [null, string | null] ]; if (rank === null) { diff --git a/frontend/.oxlintrc.json b/frontend/.oxlintrc.json index 378d2d559..2507e98bd 100644 --- a/frontend/.oxlintrc.json +++ b/frontend/.oxlintrc.json @@ -10,7 +10,8 @@ "no-explicit-any": "allow", "explicit-function-return-type": "off", "no-array-for-each": "off", - "eqeqeq": "off" + "eqeqeq": "off", + "ban-ts-comment": "off" } } ] diff --git a/frontend/__tests__/setup-tests.ts b/frontend/__tests__/setup-tests.ts index 8fe0d475e..27e92f265 100644 --- a/frontend/__tests__/setup-tests.ts +++ b/frontend/__tests__/setup-tests.ts @@ -1,7 +1,7 @@ import $ from "jquery"; -// @ts-ignore +//@ts-expect-error add to globl global["$"] = $; -// @ts-ignore +//@ts-expect-error add to globl global["jQuery"] = $; vi.mock("../src/ts/constants/env-config", () => ({ diff --git a/frontend/src/ts/config.ts b/frontend/src/ts/config.ts index 18bdfb8e4..6d16eb93b 100644 --- a/frontend/src/ts/config.ts +++ b/frontend/src/ts/config.ts @@ -1453,7 +1453,7 @@ function setThemes( if (!isConfigValueValid("themes", theme, ConfigSchemas.ThemeNameSchema)) return false; - //@ts-expect-error + //@ts-expect-error config used to have 9 if (customThemeColors.length === 9) { //color missing if (customState) { @@ -1539,7 +1539,7 @@ export function setCustomThemeColors( nosave?: boolean ): boolean { // migrate existing configs missing sub alt color - // @ts-expect-error + // @ts-expect-error legacy configs if (colors.length === 9) { //color missing Notifications.add( @@ -1931,8 +1931,8 @@ export function setCustomBackgroundFilter( array: ConfigSchemas.CustomBackgroundFilter, nosave?: boolean ): boolean { - //convert existing configs using five values down to four - //@ts-expect-error + // @ts-expect-error this used to be 5 + // need to convert existing configs using five values down to four if (array.length === 5) { array = [array[0], array[1], array[2], array[3]]; } diff --git a/frontend/src/ts/constants/env-config.ts b/frontend/src/ts/constants/env-config.ts index d834fdfc7..9bb809fc8 100644 --- a/frontend/src/ts/constants/env-config.ts +++ b/frontend/src/ts/constants/env-config.ts @@ -10,15 +10,15 @@ type Config = { //@ts-expect-error these get replaced by vite const backendUrl = BACKEND_URL; -// @ts-expect-error +// @ts-expect-error --- const isDevelopment = IS_DEVELOPMENT; -// @ts-expect-error +// @ts-expect-error --- const clientVersion = CLIENT_VERSION; -// @ts-expect-error +// @ts-expect-error --- const recaptchaSiteKey = RECAPTCHA_SITE_KEY; -// @ts-expect-error +// @ts-expect-error --- const quickLoginEmail = QUICK_LOGIN_EMAIL; -// @ts-expect-error +// @ts-expect-error --- const quickLoginPassword = QUICK_LOGIN_PASSWORD; export const envConfig: Config = { diff --git a/frontend/src/ts/controllers/ad-controller.ts b/frontend/src/ts/controllers/ad-controller.ts index e63613506..cbbab0201 100644 --- a/frontend/src/ts/controllers/ad-controller.ts +++ b/frontend/src/ts/controllers/ad-controller.ts @@ -143,7 +143,7 @@ export async function checkAdblock(): Promise { return new Promise((resolve) => { if (choice === "eg") { if (adBlock === undefined) { - //@ts-expect-error + //@ts-expect-error 3rd party ad code if (window.egAdPack === undefined) { adBlock = true; } else { @@ -151,7 +151,7 @@ export async function checkAdblock(): Promise { } } } else if (choice === "pw") { - //@ts-expect-error + //@ts-expect-error 3rd party ad code if (window.ramp === undefined) { adBlock = true; } @@ -169,13 +169,13 @@ export async function checkCookieblocker(): Promise { return; } - //@ts-expect-error + //@ts-expect-error 3rd party ad code if (window.__tcfapi === undefined) { cookieBlocker = true; resolve(); return; } - //@ts-expect-error + //@ts-expect-error 3rd party ad code // eslint-disable-next-line @typescript-eslint/no-unsafe-call window.__tcfapi("getTCData", 2, (tcData, success) => { if (success as boolean) { @@ -269,13 +269,13 @@ export function updateFooterAndVerticalAds(visible: boolean): void { export function showConsentPopup(): void { if (choice === "eg") { - //@ts-expect-error + //@ts-expect-error 3rd party ad code, doesnt have types // eslint-disable-next-line @typescript-eslint/no-unsafe-call window.__tcfapi("displayConsentUi", 2, function () { // }); } else { - //@ts-expect-error + //@ts-expect-error 3rd party ad code, doesnt have types // eslint-disable-next-line @typescript-eslint/no-unsafe-call ramp.showCmpModal(); } @@ -322,7 +322,7 @@ $(document).ready(() => { }); window.onerror = function (error): void { - //@ts-expect-error + //@ts-expect-error --- if (choice === "eg") { if (typeof error === "string" && error.startsWith("EG APS")) { $("#ad-result-wrapper .iconAndText").addClass("withLeft"); diff --git a/frontend/src/ts/controllers/captcha-controller.ts b/frontend/src/ts/controllers/captcha-controller.ts index 79e12d7d8..1d76f3d94 100644 --- a/frontend/src/ts/controllers/captcha-controller.ts +++ b/frontend/src/ts/controllers/captcha-controller.ts @@ -15,7 +15,7 @@ export function render( return; } - //@ts-expect-error + //@ts-expect-error 3rd party code, no types const widgetId = grecaptcha.render(element, { sitekey: siteKey, callback, @@ -29,7 +29,7 @@ export function reset(id: string): void { return; } - //@ts-expect-error + //@ts-expect-error 3rd party code, no types // eslint-disable-next-line @typescript-eslint/no-unsafe-call grecaptcha.reset(captchas[id]); } @@ -39,7 +39,7 @@ export function getResponse(id: string): string { return ""; } - //@ts-expect-error + //@ts-expect-error 3rd party code, no types // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call return grecaptcha.getResponse(captchas[id]); } diff --git a/frontend/src/ts/controllers/chart-controller.ts b/frontend/src/ts/controllers/chart-controller.ts index 8b85376ee..ef5b78c2e 100644 --- a/frontend/src/ts/controllers/chart-controller.ts +++ b/frontend/src/ts/controllers/chart-controller.ts @@ -87,14 +87,14 @@ class ChartWithUpdateColors< } getDataset(id: DatasetIds): ChartDataset { - //@ts-expect-error + //@ts-expect-error its too difficult to figure out these types, but this works return this.data.datasets?.find((x) => x.yAxisID === id); } getScale( id: DatasetIds extends never ? never : "x" | DatasetIds ): DatasetIds extends never ? never : CartesianScaleOptions { - //@ts-expect-error + //@ts-expect-error its too difficult to figure out these types, but this works // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access return this.options.scales[id]; } @@ -1155,7 +1155,7 @@ async function updateColors< const gridcolor = blendTwoHexColors(bgcolor, subaltcolor, 0.75); - //@ts-expect-error + //@ts-expect-error its too difficult to figure out these types, but this works chart.data.datasets[0].borderColor = (ctx): string => { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access const isPb = ctx.raw?.isPb as boolean; @@ -1177,7 +1177,7 @@ async function updateColors< if (chart?.data?.datasets[0]?.type === undefined) { if (chart.config.type === "line") { dataset0.pointBackgroundColor = (ctx): string => { - //@ts-expect-error + //@ts-expect-error not sure why raw comes out to unknown, but this works const isPb = ctx.raw?.isPb as boolean; const color = isPb ? textcolor : maincolor; return color; diff --git a/frontend/src/ts/controllers/eg-ad-controller.ts b/frontend/src/ts/controllers/eg-ad-controller.ts index 4cf446235..3de85395c 100644 --- a/frontend/src/ts/controllers/eg-ad-controller.ts +++ b/frontend/src/ts/controllers/eg-ad-controller.ts @@ -15,7 +15,7 @@ export function init(): void { export function renderResult(widerThanBreakpoint: boolean): void { if (widerThanBreakpoint) { - //@ts-expect-error + //@ts-expect-error 3rd party ad code // eslint-disable-next-line @typescript-eslint/no-unsafe-call window.egAps.render([ "ad-result", @@ -24,7 +24,7 @@ export function renderResult(widerThanBreakpoint: boolean): void { "ad-footer", ]); } else { - //@ts-expect-error + //@ts-expect-error 3rd party ad code // eslint-disable-next-line @typescript-eslint/no-unsafe-call window.egAps.render([ "ad-result-small", @@ -37,7 +37,7 @@ export function renderResult(widerThanBreakpoint: boolean): void { export function reinstate(): boolean { try { - //@ts-expect-error + //@ts-expect-error 3rd party ad code // eslint-disable-next-line @typescript-eslint/no-unsafe-call window.egAps.reinstate(); return true; @@ -48,7 +48,7 @@ export function reinstate(): boolean { } export async function refreshVisible(): Promise { - ////@ts-expect-error + ////@ts-expect-error 3rd party ad code // const adDivs = Object.keys(window.egAdPack.gptAdSlots); // const visibleAdDivs = []; // for (let i = 0; i < adDivs.length; i++) { @@ -63,6 +63,6 @@ export async function refreshVisible(): Promise { // visibleAdDivs.push(adDivs[i]); // } // } - // //@ts-ignore + // //@ts-expect-error 3rd party ad code // window.egAps.refreshAds(visibleAdDivs); } diff --git a/frontend/src/ts/controllers/input-controller.ts b/frontend/src/ts/controllers/input-controller.ts index 9064b43de..e5c261711 100644 --- a/frontend/src/ts/controllers/input-controller.ts +++ b/frontend/src/ts/controllers/input-controller.ts @@ -94,11 +94,11 @@ function updateUI(): void { //@ts-expect-error really cant be bothered fixing all these issues - its gonna get caught anyway const koChar: string = - //@ts-expect-error + //@ts-expect-error --- koCurrWord[inputGroupLength][inputCharLength] ?? - //@ts-expect-error + //@ts-expect-error --- koCurrWord[koCurrInput.length][ - //@ts-expect-error + //@ts-expect-error --- inputCharLength - koCurrWord[inputGroupLength].length ]; diff --git a/frontend/src/ts/controllers/page-controller.ts b/frontend/src/ts/controllers/page-controller.ts index 750b9cc38..601701c6e 100644 --- a/frontend/src/ts/controllers/page-controller.ts +++ b/frontend/src/ts/controllers/page-controller.ts @@ -95,7 +95,7 @@ export async function change( await previousPage?.afterHide(); await nextPage?.beforeShow({ params: options.params, - //@ts-expect-error + // @ts-expect-error for the future (i think) data: options.data, }); } diff --git a/frontend/src/ts/controllers/pw-ad-controller.ts b/frontend/src/ts/controllers/pw-ad-controller.ts index fca4b563c..e6ab88f63 100644 --- a/frontend/src/ts/controllers/pw-ad-controller.ts +++ b/frontend/src/ts/controllers/pw-ad-controller.ts @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-call */ -//@ts-nocheck +// oxlint-disable ban-ts-comment +//@ts-nocheck too many errors from 3rd party ad code import Config from "../config"; import * as ActivePage from "../states/active-page"; diff --git a/frontend/src/ts/controllers/sound-controller.ts b/frontend/src/ts/controllers/sound-controller.ts index a69274495..cb7fb5fa2 100644 --- a/frontend/src/ts/controllers/sound-controller.ts +++ b/frontend/src/ts/controllers/sound-controller.ts @@ -398,10 +398,8 @@ export async function previewClick(val: string): Promise { const clickSoundIds = Object.keys(safeClickSounds); if (!clickSoundIds.includes(val)) return; - //@ts-expect-error - safeClickSounds[val][0].sounds[0].seek(0); - //@ts-expect-error - safeClickSounds[val][0].sounds[0].play(); + safeClickSounds?.[val]?.[0]?.sounds[0]?.seek(0); + safeClickSounds?.[val]?.[0]?.sounds[0]?.play(); } export async function previewError(val: string): Promise { diff --git a/frontend/src/ts/firebase.ts b/frontend/src/ts/firebase.ts index 4f4912dd9..d09217470 100644 --- a/frontend/src/ts/firebase.ts +++ b/frontend/src/ts/firebase.ts @@ -2,7 +2,8 @@ import { FirebaseApp, initializeApp } from "firebase/app"; import { getAuth, Auth as AuthType, User } from "firebase/auth"; // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -//@ts-ignore +// oxlint-disable ban-ts-comment +// @ts-ignore as far as i remember this is for CI // eslint-disable-next-line import/no-unresolved import { firebaseConfig } from "./constants/firebase-config"; import * as Notifications from "./elements/notifications"; diff --git a/frontend/src/ts/index.ts b/frontend/src/ts/index.ts index c5f3a7f66..95ed1befb 100644 --- a/frontend/src/ts/index.ts +++ b/frontend/src/ts/index.ts @@ -48,7 +48,7 @@ import { getDevOptionsModal } from "./utils/async-modules"; function addToGlobal(items: Record): void { for (const [name, item] of Object.entries(items)) { - //@ts-expect-error + //@ts-expect-error dev window[name] = item; } } diff --git a/frontend/src/ts/pages/account.ts b/frontend/src/ts/pages/account.ts index 7e4439453..f246cbdf5 100644 --- a/frontend/src/ts/pages/account.ts +++ b/frontend/src/ts/pages/account.ts @@ -1103,7 +1103,7 @@ function sortAndRefreshHistory( } } - //@ts-expect-error + // @ts-expect-error temp temp.push(filteredResults[idx]); parsedIndexes.push(idx); } @@ -1289,7 +1289,7 @@ $(".pageAccount .group.presetFilterButtons").on( ); $(".pageAccount .content .group.aboveHistory .exportCSV").on("click", () => { - //@ts-expect-error + //@ts-expect-error dont really wanna figure out the types here but it works void Misc.downloadResultsCSV(filteredResults); }); diff --git a/frontend/src/ts/pages/leaderboards.ts b/frontend/src/ts/pages/leaderboards.ts index 849618893..c389b0cf8 100644 --- a/frontend/src/ts/pages/leaderboards.ts +++ b/frontend/src/ts/pages/leaderboards.ts @@ -316,7 +316,7 @@ async function requestData(update = false): Promise { state.pageSize = dataResponse.body.data.pageSize; if (state.type === "daily") { - //@ts-ignore not sure why this is causing errors when it's clearly defined in the schema + //@ts-expect-error not sure why this is causing errors when it's clearly defined in the schema // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment state.minWpm = dataResponse.body.data.minWpm; } diff --git a/frontend/src/ts/pages/settings.ts b/frontend/src/ts/pages/settings.ts index 465808bf5..b21503362 100644 --- a/frontend/src/ts/pages/settings.ts +++ b/frontend/src/ts/pages/settings.ts @@ -441,7 +441,7 @@ function reset(): void { $(".pageSettings .section[data-config-name='funbox'] .buttons").empty(); $(".pageSettings .section[data-config-name='fontFamily'] .buttons").empty(); for (const select of document.querySelectorAll(".pageSettings select")) { - //@ts-expect-error + //@ts-expect-error slim gets added to the html element but ts doesnt know about it // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access select?.slim?.destroy?.(); } diff --git a/frontend/src/ts/popups/video-ad-popup.ts b/frontend/src/ts/popups/video-ad-popup.ts index 86d8723f5..774527424 100644 --- a/frontend/src/ts/popups/video-ad-popup.ts +++ b/frontend/src/ts/popups/video-ad-popup.ts @@ -39,7 +39,7 @@ export async function show(): Promise { .css("opacity", 0) .removeClass("hidden") .animate({ opacity: 1 }, 125, () => { - //@ts-expect-error + //@ts-expect-error 3rd party ad code window.dataLayer.push({ event: "EG_Video" }); }); } diff --git a/frontend/src/ts/ready.ts b/frontend/src/ts/ready.ts index 07664b239..2fb17cc55 100644 --- a/frontend/src/ts/ready.ts +++ b/frontend/src/ts/ready.ts @@ -4,7 +4,7 @@ import * as MerchBanner from "./elements/merch-banner"; import * as CookiesModal from "./modals/cookies"; import * as ConnectionState from "./states/connection"; import * as AccountButton from "./elements/account-button"; -//@ts-expect-error +//@ts-expect-error no types for this package import Konami from "konami"; import * as ServerConfiguration from "./ape/server-configuration"; import { getActiveFunboxesWithFunction } from "./test/funbox/list"; diff --git a/frontend/src/ts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts index e0eb909ec..c9f49cea9 100644 --- a/frontend/src/ts/test/test-logic.ts +++ b/frontend/src/ts/test/test-logic.ts @@ -86,7 +86,7 @@ export function clearNotSignedInResult(): void { export function setNotSignedInUidAndHash(uid: string): void { if (notSignedInLastResult === null) return; notSignedInLastResult.uid = uid; - //@ts-expect-error + //@ts-expect-error really need to delete this delete notSignedInLastResult.hash; notSignedInLastResult.hash = objectHash(notSignedInLastResult); } diff --git a/frontend/src/ts/test/test-stats.ts b/frontend/src/ts/test/test-stats.ts index 766ba7e3d..3181b6cfd 100644 --- a/frontend/src/ts/test/test-stats.ts +++ b/frontend/src/ts/test/test-stats.ts @@ -74,13 +74,13 @@ export function getStats(): unknown { }; try { - // @ts-expect-error + // @ts-expect-error --- ret.keypressTimings.spacing.average = TestInput.keypressTimings.spacing.array.reduce( (previous, current) => (current += previous) ) / TestInput.keypressTimings.spacing.array.length; - // @ts-expect-error + // @ts-expect-error --- ret.keypressTimings.spacing.sd = Numbers.stdDev( TestInput.keypressTimings.spacing.array ); @@ -88,13 +88,13 @@ export function getStats(): unknown { // } try { - // @ts-expect-error + // @ts-expect-error --- ret.keypressTimings.duration.average = TestInput.keypressTimings.duration.array.reduce( (previous, current) => (current += previous) ) / TestInput.keypressTimings.duration.array.length; - // @ts-expect-error + // @ts-expect-error --- ret.keypressTimings.duration.sd = Numbers.stdDev( TestInput.keypressTimings.duration.array ); diff --git a/frontend/src/ts/utils/config.ts b/frontend/src/ts/utils/config.ts index ac6c73bd2..1a2cdcd5d 100644 --- a/frontend/src/ts/utils/config.ts +++ b/frontend/src/ts/utils/config.ts @@ -30,7 +30,7 @@ function mergeWithDefaultConfig(config: PartialConfig): Config { export function replaceLegacyValues( configObj: ConfigSchemas.PartialConfig ): ConfigSchemas.PartialConfig { - //@ts-expect-error + //@ts-expect-error legacy configs if (configObj.quickTab === true && configObj.quickRestart === undefined) { configObj.quickRestart = "tab"; } @@ -40,7 +40,7 @@ export function replaceLegacyValues( } if ( - //@ts-expect-error + //@ts-expect-error legacy configs configObj.swapEscAndTab === true && configObj.quickRestart === undefined ) { @@ -48,14 +48,14 @@ export function replaceLegacyValues( } if ( - //@ts-expect-error + //@ts-expect-error legacy configs configObj.alwaysShowCPM === true && configObj.typingSpeedUnit === undefined ) { configObj.typingSpeedUnit = "cpm"; } - //@ts-expect-error + //@ts-expect-error legacy configs if (configObj.showAverage === "wpm") { configObj.showAverage = "speed"; } @@ -65,7 +65,7 @@ export function replaceLegacyValues( } if ( - //@ts-expect-error + //@ts-expect-error legacy configs configObj.showTimerProgress === false && configObj.timerStyle === undefined ) { @@ -73,7 +73,7 @@ export function replaceLegacyValues( } if ( - //@ts-expect-error + //@ts-expect-error legacy configs configObj.showLiveWpm === true && configObj.liveSpeedStyle === undefined ) { @@ -85,7 +85,7 @@ export function replaceLegacyValues( } if ( - //@ts-expect-error + //@ts-expect-error legacy configs configObj.showLiveBurst === true && configObj.liveBurstStyle === undefined ) { @@ -97,7 +97,7 @@ export function replaceLegacyValues( } if ( - //@ts-expect-error + //@ts-expect-error legacy configs configObj.showLiveAcc === true && configObj.liveAccStyle === undefined ) { diff --git a/frontend/src/ts/utils/date-and-time.ts b/frontend/src/ts/utils/date-and-time.ts index 1ca2fdb62..4dc30a841 100644 --- a/frontend/src/ts/utils/date-and-time.ts +++ b/frontend/src/ts/utils/date-and-time.ts @@ -227,12 +227,12 @@ export function getFirstDayOfTheWeek(): Day { //modern browsers support `weekInfo` or `getWeekInfo()` if ("weekInfo" in locale) { - // @ts-ignore + // @ts-expect-error weekInfo is not in the type definition return (locale.weekInfo.firstDay as number) % 7; } if ("getWeekInfo" in locale) { - // @ts-ignore + // @ts-expect-error getWeekInfo is not in the type definition // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access return (locale.getWeekInfo().firstDay as number) % 7; } diff --git a/frontend/src/ts/utils/misc.ts b/frontend/src/ts/utils/misc.ts index cf6d7302a..c8875299b 100644 --- a/frontend/src/ts/utils/misc.ts +++ b/frontend/src/ts/utils/misc.ts @@ -151,7 +151,7 @@ export function toggleFullscreen(): void { } else if (elem.mozRequestFullScreen) { void elem.mozRequestFullScreen(); } else if (elem.webkitRequestFullscreen) { - // @ts-expect-error + // @ts-expect-error some code i found online void elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); } } else { diff --git a/packages/oxlint-config/index.json b/packages/oxlint-config/index.json index cba68f891..6029779f0 100644 --- a/packages/oxlint-config/index.json +++ b/packages/oxlint-config/index.json @@ -76,6 +76,8 @@ "no-prototype-builtins": "error", "no-regex-spaces": "error", "typescript/no-namespace": "error", + "eqeqeq": "error", + "ban-ts-comment": "error", "todo-lowerthis": "off", "max-depth": [ @@ -86,10 +88,7 @@ ], "todo": "off", - "ban-ts-comment": "off", "no-array-for-each": "off", - "eqeqeq": "error", - "prefer-ts-expect-error": "off", "consider": "off", "no-cycle": "off",