diff options
| author | Fuwn <[email protected]> | 2026-01-29 19:19:50 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-29 19:19:50 -0800 |
| commit | 7e3c7c14d3e7940bc310784e852082504b2760ce (patch) | |
| tree | 3c7d0db5afbd53f50c9299d4da9c01485afb0968 | |
| parent | feat(LandingHero): Make "See More" scroll past hero (diff) | |
| download | due.moe-7e3c7c14d3e7940bc310784e852082504b2760ce.tar.xz due.moe-7e3c7c14d3e7940bc310784e852082504b2760ce.zip | |
fix: Resolve all ESLint errors and warnings
38 files changed, 80 insertions, 48 deletions
diff --git a/.eslintrc.cjs b/.eslintrc.cjs index a18e76e2..f8f4399d 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -18,6 +18,16 @@ module.exports = { es2017: true, node: true }, + rules: { + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_' + } + ] + }, overrides: [ { files: ['*.svelte'], diff --git a/src/graphql/user/resolvers.ts b/src/graphql/user/resolvers.ts index 123f4589..285c98f0 100644 --- a/src/graphql/user/resolvers.ts +++ b/src/graphql/user/resolvers.ts @@ -59,7 +59,7 @@ const auth = async (context: Context) => { const authenticatedBadgesOperation = async ( context: Context, - operation: (identity: UserIdentity, authorised: boolean) => Promise<any> + operation: (identity: UserIdentity, authorised: boolean) => Promise<unknown> ) => { const identity = await auth(context); diff --git a/src/lib/Data/hololive.ts b/src/lib/Data/hololive.ts index 1617d6d8..7bcb153a 100644 --- a/src/lib/Data/hololive.ts +++ b/src/lib/Data/hololive.ts @@ -62,7 +62,12 @@ function parseToLiveBlocks(html: string): LiveBlock[] { const dateDiv = row.querySelector('.holodule'); if (dateDiv) { date = dateDiv.textContent?.replace(/\s+/g, '') || ''; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion date = date.match(/\d+\/\d+/)![0].replace('/', '-'); + + // const dateMatch = date.match(/\d+\/\d+/); + // + // date = dateMatch ? dateMatch[0].replace('/', '-') : ''; } const allThumbnail = row.querySelectorAll('a.thumbnail'); diff --git a/src/lib/Error/DotDotDot.svelte b/src/lib/Error/DotDotDot.svelte index 73261eba..88b46374 100644 --- a/src/lib/Error/DotDotDot.svelte +++ b/src/lib/Error/DotDotDot.svelte @@ -6,7 +6,7 @@ export let start = ''; let dots = start; - let interval: NodeJS.Timeout; + let interval: ReturnType<typeof setInterval>; onMount(() => { interval = setInterval(() => { diff --git a/src/lib/Events/AniListBadges/EasterEvent2025/EasterEgg.svelte b/src/lib/Events/AniListBadges/EasterEvent2025/EasterEgg.svelte index b7391e06..0d7ab010 100644 --- a/src/lib/Events/AniListBadges/EasterEvent2025/EasterEgg.svelte +++ b/src/lib/Events/AniListBadges/EasterEvent2025/EasterEgg.svelte @@ -71,6 +71,7 @@ if (clickedEggs.length >= 3) showPopup = true; + // eslint-disable-next-line no-undef umami.track('Easter Egg Clicked', { id }); } else if (event.button === 1) { visible = true; diff --git a/src/lib/Hololive/Stream.svelte b/src/lib/Hololive/Stream.svelte index 1c55a9dd..afe400b7 100644 --- a/src/lib/Hololive/Stream.svelte +++ b/src/lib/Hololive/Stream.svelte @@ -4,8 +4,9 @@ import identity from '$stores/identity'; import locale from '$stores/locale'; import Icon from '@iconify/svelte'; + import type { LiveInfo } from '$lib/Data/hololive'; - export let live: any; + export let live: LiveInfo; export let pinStream: (streamer: string) => void; export let pinnedStreams: string[]; export let icon: string; diff --git a/src/lib/Home/Root.svelte b/src/lib/Home/Root.svelte index bc1bdea9..eb174471 100644 --- a/src/lib/Home/Root.svelte +++ b/src/lib/Home/Root.svelte @@ -2,7 +2,7 @@ import settings from '$stores/settings'; import { fly } from 'svelte/transition'; - export let data: any; + export let data: { url: string }; export let way: number; const animationDelay = 100; diff --git a/src/lib/Layout/Dropdown.svelte b/src/lib/Layout/Dropdown.svelte index b0923fb2..e7e00272 100644 --- a/src/lib/Layout/Dropdown.svelte +++ b/src/lib/Layout/Dropdown.svelte @@ -13,8 +13,8 @@ let open = false; - const handleClickOutside = (event: any) => { - if (!event.target.closest('.dropdown')) open = false; + const handleClickOutside = (event: MouseEvent) => { + if (!(event.target as HTMLElement).closest('.dropdown')) open = false; }; </script> @@ -35,7 +35,9 @@ open = !open; }} - onkeydown={() => {}} + onkeydown={(_e) => { + // if (e.key === 'Enter' || e.key === ' ') open = !open; + }} role="button" tabindex="0" > diff --git a/src/lib/Layout/Popup.svelte b/src/lib/Layout/Popup.svelte index 1e3d7b2c..dc1557e3 100644 --- a/src/lib/Layout/Popup.svelte +++ b/src/lib/Layout/Popup.svelte @@ -12,8 +12,8 @@ export let locked = false; export let center = false; - const handleClickOutside = (event: any) => { - if (!locked && event.target.classList.contains('popup')) { + const handleClickOutside = (event: MouseEvent) => { + if (!locked && (event.target as HTMLElement).classList.contains('popup')) { show = false; onLeave(); diff --git a/src/lib/Lazy.svelte b/src/lib/Lazy.svelte index da5b09a9..fd08ed07 100644 --- a/src/lib/Lazy.svelte +++ b/src/lib/Lazy.svelte @@ -10,7 +10,7 @@ export let once = false; let element: Element; - let percent: number = 0; + let percent = 0; let visible = false; let observer: IntersectionObserver; diff --git a/src/lib/List/Anime/AnimeListTemplate.svelte b/src/lib/List/Anime/AnimeListTemplate.svelte index bcd4e806..185419de 100644 --- a/src/lib/List/Anime/AnimeListTemplate.svelte +++ b/src/lib/List/Anime/AnimeListTemplate.svelte @@ -14,6 +14,7 @@ import subsPlease from '$stores/subsPlease'; import identity from '$stores/identity'; import localforage from 'localforage'; + import type { Title } from '../mediaTitle'; export let endTime: number; export let cleanMedia: ( @@ -24,7 +25,7 @@ ) => Media[]; export let animeLists: Promise<Media[]>; export let user: AniListAuthorisation; - export let title: any; + export let title: Title; export let completed = false; export let plannedOnly = false; export let upcoming = false; diff --git a/src/lib/List/Anime/CleanAnimeList.svelte b/src/lib/List/Anime/CleanAnimeList.svelte index 04b1d03c..561b3b1d 100644 --- a/src/lib/List/Anime/CleanAnimeList.svelte +++ b/src/lib/List/Anime/CleanAnimeList.svelte @@ -19,9 +19,10 @@ import stateBin from '$stores/stateBin'; import localforage from 'localforage'; import MediaRoulette from '../MediaRoulette.svelte'; + import type { Title } from '../mediaTitle'; export let media: Media[]; - export let title: any; + export let title: Title; export let animeLists: Promise<Media[]>; export let user: AniListAuthorisation; export let endTime: number; @@ -36,7 +37,7 @@ export let limit: number | undefined = undefined; let showRoulette = false; - let keyCacher: NodeJS.Timeout; + let keyCacher: ReturnType<typeof setInterval>; let totalEpisodeDueCount = media .map((anime) => { if ($settings.displayTotalEpisodes && !$settings.displayTotalDueEpisodes) return 1; @@ -60,7 +61,7 @@ new Set( media .flatMap((m) => Object.entries(m.mediaListEntry?.customLists ?? {})) - .filter(([_, value]) => value) + .filter(([_key, value]) => value) .map(([key]) => key) ) ); diff --git a/src/lib/List/Manga/CleanMangaList.svelte b/src/lib/List/Manga/CleanMangaList.svelte index f5af25fc..bba0fb08 100644 --- a/src/lib/List/Manga/CleanMangaList.svelte +++ b/src/lib/List/Manga/CleanMangaList.svelte @@ -50,7 +50,7 @@ new Set( media .flatMap((m) => Object.entries(m.mediaListEntry?.customLists ?? {})) - .filter(([_, value]) => value) + .filter(([_key, value]) => value) .map(([key]) => key) ) ); diff --git a/src/lib/Loading/Ellipsis.svelte b/src/lib/Loading/Ellipsis.svelte index d16a2a6e..dfc8bcf4 100644 --- a/src/lib/Loading/Ellipsis.svelte +++ b/src/lib/Loading/Ellipsis.svelte @@ -3,7 +3,7 @@ </script> <div class="ellipsis" style={`--loader-colour: ${colour};`}> - {#each Array.from({ length: 4 }) as _} + {#each Array.from({ length: 4 }) as _i} <div></div> {/each} </div> diff --git a/src/lib/Loading/Grid.svelte b/src/lib/Loading/Grid.svelte index 233052fc..543c5e5f 100644 --- a/src/lib/Loading/Grid.svelte +++ b/src/lib/Loading/Grid.svelte @@ -3,7 +3,7 @@ </script> <div class="grid" style={`--loader-colour: ${colour};`}> - {#each Array.from({ length: 9 }) as _} + {#each Array.from({ length: 9 }) as _i} <div></div> {/each} </div> diff --git a/src/lib/Loading/Skeleton.svelte b/src/lib/Loading/Skeleton.svelte index 3f93d107..a0e1ab0e 100644 --- a/src/lib/Loading/Skeleton.svelte +++ b/src/lib/Loading/Skeleton.svelte @@ -12,7 +12,7 @@ {#if grid} <div class="grid" style={pad ? 'padding-top: .75em;' : ''}> - {#each Array(count) as _, i} + {#each Array(count) as _item, i} <div class={card ? `${bigCard ? 'card' : ''} card-small` : ''} style={`width: ${width};`}> <div class="skeleton-container" style={`--i: ${i};`}> <div class="skeleton" style={`width: ${width}; height: ${height};`}></div> @@ -21,7 +21,7 @@ {/each} </div> {:else} - {#each Array(count) as _, i} + {#each Array(count) as _item, i} <div class={card ? `${bigCard ? 'card' : ''} card-small` : ''} style={`width: ${width}; ${list ? 'padding-top: .75em;' : ''}; --i: ${i};`} diff --git a/src/lib/Media/Anime/Airing/AiringTime.svelte b/src/lib/Media/Anime/Airing/AiringTime.svelte index 53a39c39..8cf1cacc 100644 --- a/src/lib/Media/Anime/Airing/AiringTime.svelte +++ b/src/lib/Media/Anime/Airing/AiringTime.svelte @@ -16,7 +16,7 @@ let nextEpisode = anime.nextAiringEpisode?.episode || 0; let few = true; let dateString = ''; - let updateInterval: NodeJS.Timeout; + let updateInterval: ReturnType<typeof setInterval>; onMount(() => { const setAiringTime = () => { diff --git a/src/lib/Notification/Notification.svelte b/src/lib/Notification/Notification.svelte index ec8d5be7..864d6568 100644 --- a/src/lib/Notification/Notification.svelte +++ b/src/lib/Notification/Notification.svelte @@ -1,8 +1,9 @@ <script lang="ts"> import settings from '$stores/settings'; import { onMount } from 'svelte'; + import type { Notification } from './store'; - export let notification: { [key: string]: any } = {}; + export let notification: Notification; export let onRemove: () => void = () => { return; }; diff --git a/src/lib/Reader/Chapters/MangaDex.svelte b/src/lib/Reader/Chapters/MangaDex.svelte index 44c0d8f6..ac5ce151 100644 --- a/src/lib/Reader/Chapters/MangaDex.svelte +++ b/src/lib/Reader/Chapters/MangaDex.svelte @@ -1,5 +1,18 @@ <script lang="ts"> - export let data: any; + interface MangaDexChapter { + id: string; + attributes: { + volume?: string; + chapter: string; + title?: string; + }; + } + + interface MangaDexData { + data: MangaDexChapter[]; + } + + export let data: MangaDexData; </script> <ul> diff --git a/src/lib/Settings/Categories/RSSFeeds.svelte b/src/lib/Settings/Categories/RSSFeeds.svelte index c8a47385..51554884 100644 --- a/src/lib/Settings/Categories/RSSFeeds.svelte +++ b/src/lib/Settings/Categories/RSSFeeds.svelte @@ -6,7 +6,7 @@ import SettingHint from '../SettingHint.svelte'; import tooltip from '$lib/Tooltip/tooltip'; - export let user: any; + export let user: { accessToken: string; refreshToken: string }; </script> <button diff --git a/src/lib/Tools/DumpProfile.svelte b/src/lib/Tools/DumpProfile.svelte index 704bca8a..717814d2 100644 --- a/src/lib/Tools/DumpProfile.svelte +++ b/src/lib/Tools/DumpProfile.svelte @@ -27,7 +27,6 @@ }; </script> -<!-- svelte-ignore missing-declaration --> <InputTemplate field="Username" bind:submission event="Dump User" submitText="Dump"> {#await dumpUser(submission)} <Skeleton card={false} count={1} height="500px" /> diff --git a/src/lib/Tools/FollowFix.svelte b/src/lib/Tools/FollowFix.svelte index 58f31e8c..62548379 100644 --- a/src/lib/Tools/FollowFix.svelte +++ b/src/lib/Tools/FollowFix.svelte @@ -13,7 +13,6 @@ <LogInRestricted /> {:else} <p> - <!-- svelte-ignore missing-declaration --> <input type="text" minlength="1" diff --git a/src/lib/Tools/InputTemplate.svelte b/src/lib/Tools/InputTemplate.svelte index 5627eda6..48913646 100644 --- a/src/lib/Tools/InputTemplate.svelte +++ b/src/lib/Tools/InputTemplate.svelte @@ -25,7 +25,6 @@ <div class="card"> <div> - <!-- svelte-ignore missing-declaration --> <input type="text" placeholder={field} diff --git a/src/lib/Tools/Wrapped/Tool.svelte b/src/lib/Tools/Wrapped/Tool.svelte index 3676cbdd..3985b4c0 100644 --- a/src/lib/Tools/Wrapped/Tool.svelte +++ b/src/lib/Tools/Wrapped/Tool.svelte @@ -981,7 +981,7 @@ > <br /> <select bind:value={selectedYear} disabled={needsRefetch}> - {#each Array.from({ length: currentYear - 2012 }) as _, i} + {#each Array.from({ length: currentYear - 2012 }) as _item, i} <option value={currentYear - i}> {currentYear - i} </option> diff --git a/src/lib/Tooltip/LinkedTooltip.svelte b/src/lib/Tooltip/LinkedTooltip.svelte index cf004345..290dbab3 100644 --- a/src/lib/Tooltip/LinkedTooltip.svelte +++ b/src/lib/Tooltip/LinkedTooltip.svelte @@ -5,7 +5,7 @@ export let id: string | undefined = undefined; export let pin: string | undefined = undefined; export let content: string; - export let disable: boolean = false; + export let disable = false; export let pinPosition: 'top' | 'bottom' | 'left' | 'right' = 'top'; export let offset = 10; export let tooltipTransitionTime = 200; diff --git a/src/lib/User/BadgeWall/BadgePreview.svelte b/src/lib/User/BadgeWall/BadgePreview.svelte index 2f4d65c7..062fdac7 100644 --- a/src/lib/User/BadgeWall/BadgePreview.svelte +++ b/src/lib/User/BadgeWall/BadgePreview.svelte @@ -10,8 +10,8 @@ import ParallaxImage from '$lib/Image/ParallaxImage.svelte'; export let selectedBadge: Badge | undefined; - export let onNext: () => void = () => {}; - export let onPrevious: () => void = () => {}; + export let onNext: () => void = () => undefined; + export let onPrevious: () => void = () => undefined; export let hasNext: boolean; export let hasPrevious: boolean; @@ -39,8 +39,8 @@ onMount(() => { badgeReference = document.querySelector('.badge-container-image') as HTMLImageElement; - const handleClickOutside = (event: any) => { - if (event.target.classList.contains('popup')) selectedBadge = undefined; + const handleClickOutside = (event: MouseEvent) => { + if ((event.target as HTMLElement).classList.contains('popup')) selectedBadge = undefined; }; document.addEventListener('click', handleClickOutside); diff --git a/src/lib/Utility/device.ts b/src/lib/Utility/device.ts index 4687e1d8..fa3aeda9 100644 --- a/src/lib/Utility/device.ts +++ b/src/lib/Utility/device.ts @@ -6,7 +6,7 @@ export const mobile = () => { /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test( a ) || - /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test( a.substr(0, 4) ) ) diff --git a/src/lib/Utility/image.ts b/src/lib/Utility/image.ts index fecc11b5..b8ed0663 100644 --- a/src/lib/Utility/image.ts +++ b/src/lib/Utility/image.ts @@ -36,7 +36,7 @@ export const thumbnail = (url: string | undefined) => { const match = url.match(/attachments\/(\d+)\/(\d+)\/(.+)/); if (match) { - const [_, server, id, file] = match; + const [, server, id, file] = match; return `https://media.discordapp.net/attachments/${server}/${id}/${file}?width=${width}&height=${height}`; } diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 96d91f0f..4d78b29f 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -44,7 +44,7 @@ let isHeaderVisible = true; let previousScrollPosition = 0; - let notificationInterval: NodeJS.Timeout | undefined = undefined; + let notificationInterval: ReturnType<typeof setInterval> | undefined = undefined; addMessages('en', english as unknown as LocaleDictionary); addMessages('ja', japanese as unknown as LocaleDictionary); diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index ca356724..fb80bbdd 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -18,7 +18,7 @@ export let data; - let heightObserver: NodeJS.Timeout; + let heightObserver: ReturnType<typeof setInterval>; onMount(() => { heightObserver = setInterval(() => createHeightObserver(), 0); diff --git a/src/routes/completed/+page.svelte b/src/routes/completed/+page.svelte index f9fb433d..3c6b3b4d 100644 --- a/src/routes/completed/+page.svelte +++ b/src/routes/completed/+page.svelte @@ -16,7 +16,7 @@ export let data; - let heightObserver: NodeJS.Timeout; + let heightObserver: ReturnType<typeof setInterval>; onMount(() => { heightObserver = setInterval(() => createHeightObserver(), 0); diff --git a/src/routes/events/group/[group]/+page.svelte b/src/routes/events/group/[group]/+page.svelte index 6d2728bb..6265fb75 100644 --- a/src/routes/events/group/[group]/+page.svelte +++ b/src/routes/events/group/[group]/+page.svelte @@ -16,9 +16,9 @@ groupsResponse = fetch(root(`/api/events/group?slug=${data.group}`)); }); - const asGroup = (group: any) => group as GroupType; + const asGroup = (group: unknown) => group as GroupType; - const asEvent = (event: any) => event as EventType; + const asEvent = (event: unknown) => event as EventType; </script> {#await groupsResponse} diff --git a/src/routes/events/groups/+page.svelte b/src/routes/events/groups/+page.svelte index 6b9d8a10..685225be 100644 --- a/src/routes/events/groups/+page.svelte +++ b/src/routes/events/groups/+page.svelte @@ -12,7 +12,7 @@ groupsResponse = fetch(root('/api/events/groups')); }); - const asGroup = (group: any) => group as GroupType; + const asGroup = (group: unknown) => group as GroupType; </script> {#await groupsResponse} diff --git a/src/routes/updates/+page.svelte b/src/routes/updates/+page.svelte index 9af001b4..22fcd3a7 100644 --- a/src/routes/updates/+page.svelte +++ b/src/routes/updates/+page.svelte @@ -21,7 +21,7 @@ let mangaEndTime: number; let novelEndTime: number; let directLink = browser ? new URLSearchParams(window.location.search).has('d') : false; - let heightObserver: NodeJS.Timeout; + let heightObserver: ReturnType<typeof setInterval>; onMount(async () => { heightObserver = setInterval(() => createHeightObserver(false), 0); diff --git a/src/routes/user/[user]/+page.svelte b/src/routes/user/[user]/+page.svelte index eeeebf91..3c581c38 100644 --- a/src/routes/user/[user]/+page.svelte +++ b/src/routes/user/[user]/+page.svelte @@ -126,10 +126,10 @@ if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'; }; - const handleDragOver = (event: any) => { + const handleDragOver = (event: DragEvent) => { event.preventDefault(); - event.dataTransfer.dropEffect = 'move'; + if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'; }; const handleDragEnter = ( diff --git a/src/routes/user/[user]/badges/+page.svelte b/src/routes/user/[user]/badges/+page.svelte index 69b74917..386fe7b1 100644 --- a/src/routes/user/[user]/badges/+page.svelte +++ b/src/routes/user/[user]/badges/+page.svelte @@ -343,7 +343,7 @@ groupedBadges[badge.category].push(badge); }); - Object.entries(groupedBadges).forEach(([_category, badges]) => { + Object.entries(groupedBadges).forEach(([_categoryKey, badges]) => { badges.forEach((badge, index) => { badge.index = index; }); @@ -506,9 +506,9 @@ return previousBadge; }; - const castAsStringArray = (array: any[]) => array as string[]; + const castAsStringArray = (array: unknown[]) => array as string[]; - const castBadgesToIndexedBadges = (array: any[]) => array as IndexedBadge[]; + const castBadgesToIndexedBadges = (array: unknown[]) => array as IndexedBadge[]; const shadowHideBadge = () => { if (!selectedBadge && !authorised) return; diff --git a/src/stores/stateBin.ts b/src/stores/stateBin.ts index 6f46593c..f724860a 100644 --- a/src/stores/stateBin.ts +++ b/src/stores/stateBin.ts @@ -27,7 +27,7 @@ if (browser) { const createProxyStore = (store: Writable<StateBin>) => { return new Proxy(store, { get(target, prop: string) { - if (prop in target) return (target as any)[prop]; + if (prop in target) return (target as unknown as Record<string, unknown>)[prop]; const derivedKey = writable(get(store)[prop]); diff --git a/src/trigger/notifications.ts b/src/trigger/notifications.ts index e801e07d..77b8713f 100644 --- a/src/trigger/notifications.ts +++ b/src/trigger/notifications.ts @@ -4,7 +4,7 @@ import { createClient } from '@supabase/supabase-js'; export const notificationsTask = schedules.task({ id: 'notifications', - run: async (_payload: any, { ctx }) => { + run: async (_payload, { ctx }) => { const environment = ctx.environment.slug; const triggerProjectReference = ctx.project.ref; const getUserSubscriptions = async () => { |