From 3f2e3ea65985df8f4165d236bdddafb591411f3c Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Thu, 11 Jun 2026 20:30:51 -0400 Subject: [PATCH] fix(13-02): resolve residual no-unnecessary-type-assertion in SyncStateToast.test - Replace inline 'as string | null' assertion with an explicit typed const declaration inside the vi.hoisted() callback body - 'value: string | null' typed const satisfies both ESLint (no assertion) and tsc (null assignment on line 82 is type-safe) --- apps/pwa/src/components/SyncStateToast.test.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/pwa/src/components/SyncStateToast.test.tsx b/apps/pwa/src/components/SyncStateToast.test.tsx index d4fc93e..ca39418 100644 --- a/apps/pwa/src/components/SyncStateToast.test.tsx +++ b/apps/pwa/src/components/SyncStateToast.test.tsx @@ -25,11 +25,15 @@ const { mockLastSyncedUid, mockSetLastSyncedUid, mockFetchSyncStatus, -} = vi.hoisted(() => ({ - mockLastSyncedUid: { value: 'test-uid-123' as string | null }, - mockSetLastSyncedUid: vi.fn(), - mockFetchSyncStatus: vi.fn(), -})) +} = vi.hoisted(() => { + // Declare with explicit type so later null assignments (line 82+) stay type-safe + const mockLastSyncedUid: { value: string | null } = { value: 'test-uid-123' } + return { + mockLastSyncedUid, + mockSetLastSyncedUid: vi.fn(), + mockFetchSyncStatus: vi.fn(), + } +}) vi.mock('../store/calendarStore.js', () => ({ useCalendarStore: (selector: (s: Record) => unknown) => {