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/routes/+layout.svelte | 78 ++++++++++++++++++++++++-----------------------
 1 file changed, 40 insertions(+), 38 deletions(-)

(limited to 'src/routes/+layout.svelte')

diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index a35fee29..f58bff4d 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,47 +1,47 @@
 <script lang="ts">
-import Spacer from "$lib/Layout/Spacer.svelte";
-import type { SubsPleaseEpisode } from "$lib/Media/Anime/Airing/Subtitled/subsPlease";
+import { onDestroy, onMount } from "svelte";
+import { browser } from "$app/environment";
 import { env } from "$env/dynamic/public";
 import { userIdentity as getUserIdentity } from "$lib/Data/AniList/identity";
-import { onDestroy, onMount } from "svelte";
+import HeadTitle from "$lib/Home/HeadTitle.svelte";
+import Spacer from "$lib/Layout/Spacer.svelte";
+import type { SubsPleaseEpisode } from "$lib/Media/Anime/Airing/Subtitled/subsPlease";
 import userIdentity from "$stores/identity";
 import settings from "$stores/settings";
-import { browser } from "$app/environment";
-import HeadTitle from "$lib/Home/HeadTitle.svelte";
 import "../app.css";
-import { get, readable, type Readable } from "svelte/store";
-import { navigating } from "$app/stores";
-import { onNavigate } from "$app/navigation";
-import NotificationsProvider from "$lib/Notification/NotificationsProvider.svelte";
-import Root from "$lib/Home/Root.svelte";
-import root from "$lib/Utility/root";
-import { addMessages, init, locale as i18nLocale, locales } from "svelte-i18n";
-import english from "$lib/Locale/english";
-import japanese from "$lib/Locale/japanese";
-import type { LocaleDictionary } from "$lib/Locale/layout";
-import locale from "$stores/locale";
-import Skeleton from "$lib/Loading/Skeleton.svelte";
-import subsPlease from "$stores/subsPlease";
-import Dropdown from "$lib/Layout/Dropdown.svelte";
+import { injectAnalytics } from "@vercel/analytics/sveltekit";
 import { injectSpeedInsights } from "@vercel/speed-insights/sveltekit";
-import subtitles from "$lib/Data/Static/subtitles.json";
-import settingsSyncPulled from "$stores/settingsSyncPulled";
-import settingsSyncTimes from "$stores/settingsSyncTimes";
+import Lenis from "lenis";
+import localforage from "localforage";
+import { get, type Readable, readable } from "svelte/store";
+import { addMessages, locale as i18nLocale, init, locales } from "svelte-i18n";
+import { dev } from "$app/environment";
+import { onNavigate } from "$app/navigation";
+import { navigating } from "$app/stores";
 import Announcement from "$lib/Announcement.svelte";
-import Message from "$lib/Loading/Message.svelte";
-import { requestNotifications } from "$lib/Utility/notifications";
-import { database as userDatabase } from "$lib/Database/IDB/user";
-import CommandPalette from "$lib/CommandPalette/CommandPalette.svelte";
 import { track } from "$lib/analytics";
 import { defaultActions } from "$lib/CommandPalette/actions";
 import { authActions } from "$lib/CommandPalette/authActions";
+import CommandPalette from "$lib/CommandPalette/CommandPalette.svelte";
 import { syncActions } from "$lib/CommandPalette/syncActions";
 import { toggleActions } from "$lib/CommandPalette/toggleActions";
+import subtitles from "$lib/Data/Static/subtitles.json";
+import { database as userDatabase } from "$lib/Database/IDB/user";
+import Root from "$lib/Home/Root.svelte";
+import Dropdown from "$lib/Layout/Dropdown.svelte";
+import Message from "$lib/Loading/Message.svelte";
+import Skeleton from "$lib/Loading/Skeleton.svelte";
+import english from "$lib/Locale/english";
+import japanese from "$lib/Locale/japanese";
+import type { LocaleDictionary } from "$lib/Locale/layout";
+import NotificationsProvider from "$lib/Notification/NotificationsProvider.svelte";
 import { toolsAsCommandPaletteActions } from "$lib/Tools/tools";
-import localforage from "localforage";
-import { dev } from "$app/environment";
-import { injectAnalytics } from "@vercel/analytics/sveltekit";
-import Lenis from "lenis";
+import { requestNotifications } from "$lib/Utility/notifications";
+import root from "$lib/Utility/root";
+import locale from "$stores/locale";
+import settingsSyncPulled from "$stores/settingsSyncPulled";
+import settingsSyncTimes from "$stores/settingsSyncTimes";
+import subsPlease from "$stores/subsPlease";
 import "lenis/dist/lenis.css";
 import lenisStore from "$stores/lenis";
 import type { LayoutData } from "./$types";
@@ -53,9 +53,8 @@ export let data: LayoutData;
 
 let isHeaderVisible = true;
 let previousScrollPosition = 0;
-let notificationInterval: ReturnType<typeof setInterval> | undefined =
-	undefined;
-let lenis: Lenis | undefined = undefined;
+let notificationInterval: ReturnType<typeof setInterval> | undefined;
+let lenis: Lenis | undefined;
 let isMenuOpen = false;
 
 addMessages("en", english as unknown as LocaleDictionary);
@@ -74,7 +73,7 @@ const navigationOrder = [
 ];
 const previousPage: Readable<string | null> = readable(null, (set) => {
 	const unsubscribe = navigating.subscribe(($navigating) => {
-		if ($navigating && $navigating.from)
+		if ($navigating?.from)
 			set($navigating.from.url.pathname as unknown as null);
 	});
 
@@ -83,7 +82,7 @@ const previousPage: Readable<string | null> = readable(null, (set) => {
 
 $: way = data.url.includes("/user")
 	? 200
-	: $previousPage && $previousPage.includes("/user")
+	: $previousPage?.includes("/user")
 		? -200
 		: navigationOrder.indexOf(data.url) >
 				navigationOrder.indexOf($previousPage ?? "/")
@@ -116,7 +115,10 @@ onNavigate((navigation) => {
 				? 1
 				: -1;
 
-	document.documentElement.style.setProperty("--vt-direction", String(direction));
+	document.documentElement.style.setProperty(
+		"--vt-direction",
+		String(direction),
+	);
 
 	return new Promise((resolve) => {
 		(
@@ -238,13 +240,13 @@ onMount(async () => {
 			(response) => {
 				if (response.ok)
 					response.json().then((data) => {
-						if (data && data.configuration) {
+						if (data?.configuration) {
 							console.log("Pulled remote configuration");
 							settings.set(data.configuration);
 							settingsSyncPulled.set(true);
 							settingsSyncTimes.set({
 								lastPull: new Date(),
-								lastPush: new Date(data.updated_at + "Z"),
+								lastPush: new Date(`${data.updated_at}Z`),
 							});
 						}
 					});
-- 
cgit v1.2.3

