From 241e4874ad5c44d34e1cd7e1322d30cbe843f4d7 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 29 Mar 2026 20:12:45 +0200 Subject: [PATCH] fix: resolve lint and type-check issues introduced by persons redesign - Cast PersonSummaryDTO array to concrete type in +page.server.ts (all fields are optional in the generated type but always populated at runtime) - Cast mockLocals/mockLocalsWriter to `any` in persons detail spec to match the pre-existing test pattern used throughout the codebase - Add .svelte-kit-backup/ to .gitignore and .prettierignore to prevent lint failures from Docker-owned leftover .svelte-kit directory Co-Authored-By: Claude Sonnet 4.6 --- frontend/.gitignore | 1 + frontend/.prettierignore | 4 ++++ frontend/src/routes/+page.server.ts | 7 +++++-- frontend/src/routes/persons/[id]/page.server.spec.ts | 6 ++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/frontend/.gitignore b/frontend/.gitignore index 79a69b7d..3f9bc1b0 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -6,6 +6,7 @@ node_modules .netlify .wrangler /.svelte-kit +/.svelte-kit-backup /build # OS diff --git a/frontend/.prettierignore b/frontend/.prettierignore index dc7a1d03..507fbd90 100644 --- a/frontend/.prettierignore +++ b/frontend/.prettierignore @@ -8,6 +8,10 @@ bun.lockb # Miscellaneous /static/ +# Build artifacts +/.svelte-kit/ +/.svelte-kit-backup/ + # Generated files /src/lib/generated/ /src/lib/paraglide/ diff --git a/frontend/src/routes/+page.server.ts b/frontend/src/routes/+page.server.ts index 9c6c1c64..1b106903 100644 --- a/frontend/src/routes/+page.server.ts +++ b/frontend/src/routes/+page.server.ts @@ -45,8 +45,11 @@ export async function load({ url, fetch }) { } const documents: Document[] = docsResult?.data ?? []; - const allPersons: { id: string; firstName: string; lastName: string }[] = - personsResult.data ?? []; + const allPersons = (personsResult.data ?? []) as { + id: string; + firstName: string; + lastName: string; + }[]; const senderObj = allPersons.find((p) => p.id === senderId); const receiverObj = allPersons.find((p) => p.id === receiverId); diff --git a/frontend/src/routes/persons/[id]/page.server.spec.ts b/frontend/src/routes/persons/[id]/page.server.spec.ts index dcdb1c5f..3994fe40 100644 --- a/frontend/src/routes/persons/[id]/page.server.spec.ts +++ b/frontend/src/routes/persons/[id]/page.server.spec.ts @@ -6,8 +6,10 @@ vi.mock('$lib/api.server', () => ({ createApiClient: vi.fn() })); import { createApiClient } from '$lib/api.server'; const mockFetch = vi.fn() as unknown as typeof fetch; -const mockLocals = { user: { groups: [{ permissions: ['READ_ALL'] }] } }; -const mockLocalsWriter = { user: { groups: [{ permissions: ['WRITE_ALL'] }] } }; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const mockLocals = { user: { groups: [{ permissions: ['READ_ALL'] }] } } as any; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const mockLocalsWriter = { user: { groups: [{ permissions: ['WRITE_ALL'] }] } } as any; beforeEach(() => vi.clearAllMocks());