From 49879c43ebd9f36ec19f4c02fa2b121314126286 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.net>
Date: Fri, 29 May 2026 23:44:08 +0000
Subject: style: apply biome autofixes and resolve remaining lint findings

Auto-fixed cosmetic findings (import ordering, obj["k"]->obj.k, optional
chaining, template literals, Date.now, parseInt radix, useless ternaries/
switch cases). Resolved the non-autofixable rest by hand:

- Senpy: static-only class -> object literal (no this/static reliance).
- app.html: var global shim -> window.global = window (keeps the shim,
  drops the unused-var flag).
- biome-ignore with rationale for the logout document.cookie clear and the
  holodule scrape non-null assertion.

Verified: biome check 0 diagnostics, svelte-check 0/0, 24/24 unit tests.
---
 src/lib/Tools/Wrapped/Tool.svelte | 75 +++++++++++++++++++--------------------
 1 file changed, 36 insertions(+), 39 deletions(-)

(limited to 'src/lib/Tools/Wrapped/Tool.svelte')

diff --git a/src/lib/Tools/Wrapped/Tool.svelte b/src/lib/Tools/Wrapped/Tool.svelte
index b7d67cb0..44ac78f1 100644
--- a/src/lib/Tools/Wrapped/Tool.svelte
+++ b/src/lib/Tools/Wrapped/Tool.svelte
@@ -1,45 +1,45 @@
 <script lang="ts">
 import Spacer from "$lib/Layout/Spacer.svelte";
 import "./wrapped.css";
-import userIdentity from "$stores/identity";
-import locale from "$stores/locale";
-import type { AniListAuthorisation } from "$lib/Data/AniList/identity";
+import { domToBlob } from "modern-screenshot";
 import { onMount } from "svelte";
+import { browser } from "$app/environment";
+import { page } from "$app/stores";
 import {
-	tops,
-	wrapped,
-	type TopMedia,
-	SortOptions,
-	type Wrapped,
-} from "$lib/Data/AniList/wrapped";
-import {
+	type ActivityHistoryEntry,
 	fullActivityHistory,
 	activityHistory as getActivityHistory,
-	type ActivityHistoryEntry,
 } from "$lib/Data/AniList/activity";
-import { Type, mediaListCollection, type Media } from "$lib/Data/AniList/media";
+import type { AniListAuthorisation } from "$lib/Data/AniList/identity";
+import { type Media, mediaListCollection, Type } from "$lib/Data/AniList/media";
+import {
+	SortOptions,
+	type TopMedia,
+	tops,
+	type Wrapped,
+	wrapped,
+} from "$lib/Data/AniList/wrapped";
+import { database } from "$lib/Database/IDB/activities";
+import LogInRestricted from "$lib/Error/LogInRestricted.svelte";
+import RateLimitedError from "$lib/Error/RateLimited.svelte";
+import Message from "$lib/Loading/Message.svelte";
+import Skeleton from "$lib/Loading/Skeleton.svelte";
+import SettingHint from "$lib/Settings/SettingHint.svelte";
+import tooltip from "$lib/Tooltip/tooltip";
 import anime from "$stores/anime";
+import userIdentity from "$stores/identity";
 import lastPruneTimes from "$stores/lastPruneTimes";
+import locale from "$stores/locale";
 import manga from "$stores/manga";
-import RateLimitedError from "$lib/Error/RateLimited.svelte";
-import { domToBlob } from "modern-screenshot";
-import { browser } from "$app/environment";
-import { page } from "$app/stores";
 import { clearAllParameters } from "../../Utility/parameters";
-import SettingHint from "$lib/Settings/SettingHint.svelte";
-import { database } from "$lib/Database/IDB/activities";
+import ActivityHistory from "./ActivityHistory.svelte";
+import DataLoader from "./DataLoader.svelte";
+import MediaPanel from "./Media.svelte";
+import MediaExtras from "./MediaExtras.svelte";
 import Activity from "./Top/Activity.svelte";
 import Anime from "./Top/Anime.svelte";
 import Manga from "./Top/Manga.svelte";
-import ActivityHistory from "./ActivityHistory.svelte";
-import MediaExtras from "./MediaExtras.svelte";
-import MediaPanel from "./Media.svelte";
 import Watermark from "./Watermark.svelte";
-import DataLoader from "./DataLoader.svelte";
-import Skeleton from "$lib/Loading/Skeleton.svelte";
-import Message from "$lib/Loading/Message.svelte";
-import tooltip from "$lib/Tooltip/tooltip";
-import LogInRestricted from "$lib/Error/LogInRestricted.svelte";
 
 export let user: AniListAuthorisation;
 
@@ -48,12 +48,12 @@ let selectedYear = currentYear;
 let episodes = 0;
 let chapters = 0;
 let minutesWatched = 0;
-let animeList: Media[] | undefined = undefined;
-let mangaList: Media[] | undefined = undefined;
-let calculatedAnimeList: Media[] | undefined = undefined;
-let calculatedMangaList: Media[] | undefined = undefined;
-let originalAnimeList: Media[] | undefined = undefined;
-let originalMangaList: Media[] | undefined = undefined;
+let animeList: Media[] | undefined;
+let mangaList: Media[] | undefined;
+let calculatedAnimeList: Media[] | undefined;
+let calculatedMangaList: Media[] | undefined;
+let originalAnimeList: Media[] | undefined;
+let originalMangaList: Media[] | undefined;
 let transparency = false;
 let lightTheme = true;
 let watermark = false;
@@ -458,7 +458,7 @@ async function update() {
 		$anime,
 		$lastPruneTimes.anime,
 		{
-			forcePrune: dateTicked ? false : true,
+			forcePrune: !dateTicked,
 			includeCompleted: true,
 			all: true,
 		},
@@ -523,7 +523,6 @@ async function update() {
 							b.duration * b.mediaListEntry.progress -
 							a.duration * a.mediaListEntry.progress
 						);
-				case SortOptions.SCORE:
 				default:
 					if (a.mediaListEntry?.score === undefined) return 1;
 					else if (b.mediaListEntry?.score === undefined) return -1;
@@ -582,7 +581,6 @@ async function update() {
 							b.duration * b.mediaListEntry.progress -
 							a.duration * a.mediaListEntry.progress
 						);
-				case SortOptions.SCORE:
 				default:
 					if (a.mediaListEntry?.score === undefined) return 1;
 					else if (b.mediaListEntry?.score === undefined) return -1;
@@ -597,7 +595,7 @@ async function update() {
 		$manga,
 		$lastPruneTimes.manga,
 		{
-			forcePrune: dateTicked ? false : true,
+			forcePrune: !dateTicked,
 			includeCompleted: true,
 			all: true,
 		},
@@ -716,9 +714,8 @@ const screenshot = async () => {
 			const object = (
 				window.URL ||
 				window.webkitURL ||
-				window ||
-				{}
-			).createObjectURL(blob);
+				window
+			)?.createObjectURL(blob);
 
 			// downloadWrapper.download = `due_dot_moe_wrapped_${dark ? 'dark' : 'light'}.png`;
 			downloadWrapper.href = object;
-- 
cgit v1.2.3

