From 5ed60ef3cc74a16eeed5c71138fcefb2468550c4 Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Sat, 9 May 2026 23:35:21 +0800 Subject: [PATCH] chore: fix lint/type issues from seven-feature integration --- app/game/[id]/game-page-client.tsx | 12 ------------ app/game/[id]/page.tsx | 12 ++++++------ app/games/games-page-client.tsx | 12 +++++------- components/charts/BatteryLifeChart.tsx | 9 +++++---- lib/api/auto-pin.ts | 2 +- lib/api/screenshots.ts | 2 +- 6 files changed, 18 insertions(+), 31 deletions(-) diff --git a/app/game/[id]/game-page-client.tsx b/app/game/[id]/game-page-client.tsx index a782c37..2269962 100644 --- a/app/game/[id]/game-page-client.tsx +++ b/app/game/[id]/game-page-client.tsx @@ -276,9 +276,6 @@ function HeroInfo({ stats, session, counts, - coverImage, - imgError, - handleImgError, platformSupport, protonDbUrl, steamDbUrl, @@ -290,9 +287,6 @@ function HeroInfo({ stats: StatsResponse | null session: { user?: { id?: string } } | null counts: Counts - coverImage: string | null - imgError: boolean - handleImgError: () => void platformSupport: PlatformSupport[] protonDbUrl: string | null steamDbUrl: string | null @@ -776,9 +770,6 @@ export function GamePageClient({ stats={stats} session={session} counts={counts} - coverImage={coverImage} - imgError={imgError} - handleImgError={handleImgError} platformSupport={platformSupport} protonDbUrl={protonDbUrl} steamDbUrl={steamDbUrl} @@ -817,9 +808,6 @@ export function GamePageClient({ stats={stats} session={session} counts={counts} - coverImage={coverImage} - imgError={imgError} - handleImgError={handleImgError} platformSupport={platformSupport} protonDbUrl={protonDbUrl} steamDbUrl={steamDbUrl} diff --git a/app/game/[id]/page.tsx b/app/game/[id]/page.tsx index d63998a..7d23954 100644 --- a/app/game/[id]/page.tsx +++ b/app/game/[id]/page.tsx @@ -284,9 +284,9 @@ export default async function GamePage({ estimatedBatteryMin: p.estimatedBatteryMin ?? null, tdpWatts: p.tdpWatts ?? null, youtubeVideoId: p.youtubeVideoId ?? null, - screenshots: null, - hardwareWattHours: null, - hardwareDeviceType: null, + screenshots: null as Array<{ id: string; url: string; width: number; height: number; orderIndex: number }> | null, + hardwareWattHours: null as number | null, + hardwareDeviceType: null as string | null, customSystem: p.customSystem ?? false, userNotes: p.userNotes, userId: p.userId, @@ -319,7 +319,7 @@ export default async function GamePage({ width: ss.width, height: ss.height, orderIndex: ss.orderIndex, - })) as any + })) const [hw] = await db .select({ @@ -330,8 +330,8 @@ export default async function GamePage({ .where(eq(hardware.slug, preset.hardwareSlug)) .limit(1) - preset.hardwareWattHours = hw?.wattHours ? Number(hw.wattHours) : null as any - preset.hardwareDeviceType = (hw?.deviceType ?? null) as any + preset.hardwareWattHours = hw?.wattHours ? Number(hw.wattHours) : null + preset.hardwareDeviceType = hw?.deviceType ?? null } return ( diff --git a/app/games/games-page-client.tsx b/app/games/games-page-client.tsx index 3dc8736..3cf0f63 100644 --- a/app/games/games-page-client.tsx +++ b/app/games/games-page-client.tsx @@ -269,9 +269,8 @@ export function GamesPageClient({ ) } - function FilterPanelContent() { - return ( - <> + const filterPanelContent = ( + <> {/* Device filter */}
@@ -491,8 +490,7 @@ export function GamesPageClient({ )} - ) - } + ) return (
@@ -608,7 +606,7 @@ export function GamesPageClient({ {/* Mobile drawer */} setShowFilters(false)}>
- + {filterPanelContent}
@@ -620,7 +618,7 @@ export function GamesPageClient({ exit={{ opacity: 0, height: 0 }} className="hidden lg:flex flex-col gap-3 pt-1" > - + {filterPanelContent} )}
diff --git a/components/charts/BatteryLifeChart.tsx b/components/charts/BatteryLifeChart.tsx index 488d58e..163eb15 100644 --- a/components/charts/BatteryLifeChart.tsx +++ b/components/charts/BatteryLifeChart.tsx @@ -32,7 +32,7 @@ export function BatteryLifeChart({ data, deviceNames }: BatteryLifeChartProps) { } // Build trend lines: for each device, compute wattHours / tdp = hours for a range of TDPs - const series: any[] = [] + const series: Array> = [] let seriesIdx = 0 for (const [slug, points] of deviceGroups.entries()) { @@ -70,9 +70,10 @@ export function BatteryLifeChart({ data, deviceNames }: BatteryLifeChartProps) { const option = { tooltip: { trigger: "item" as const, - formatter: (params: any) => { - if (params.seriesName.includes("(est.)")) return "" - return `${params.seriesName}
TDP: ${params.value[0]}W
Battery: ~${params.value[1]}h` + formatter: (params: unknown) => { + const p = params as { seriesName?: string; value?: [number, number] } + if (!p.seriesName || p.seriesName.includes("(est.)")) return "" + return `${p.seriesName}
TDP: ${p.value?.[0]}W
Battery: ~${p.value?.[1]}h` }, }, legend: { diff --git a/lib/api/auto-pin.ts b/lib/api/auto-pin.ts index 3e80a86..dc52e46 100644 --- a/lib/api/auto-pin.ts +++ b/lib/api/auto-pin.ts @@ -1,6 +1,6 @@ import { db } from "@/lib/db/index" import { performanceEntries } from "@/lib/db/schema" -import { eq, and } from "drizzle-orm" +import { eq } from "drizzle-orm" /** * Auto-pin check: an entry is eligible for auto-pinning when: diff --git a/lib/api/screenshots.ts b/lib/api/screenshots.ts index df1c273..6c8c5b4 100644 --- a/lib/api/screenshots.ts +++ b/lib/api/screenshots.ts @@ -167,7 +167,7 @@ export const screenshotRoutes = new Elysia({ prefix: "/performance" }) // ── List screenshots ──────────────────────────────────────────── .get( "/:id/screenshots", - async ({ params, set }) => { + async ({ params }) => { const screenshots = await db .select({ id: entryScreenshots.id,