fix(13-02): eliminate all ESLint violations — pnpm lint exits 0
- eslint.config.js: disable React Compiler rules (v7 flat.recommended enables
them; codebase does not use the Compiler); add e2e/ to disableTypeChecked
block; promote exhaustive-deps to error
- API broker: remove redundant as-casts (outboxWorker, poller, reminderScheduler,
expand, sync, vevent, spike); add targeted ical.js no-unsafe-assignment/argument
disables with justifying comments inside try blocks
- API routes/sse.ts: fix no-misused-promises on async writeSSE callback with
void+IIFE+catch pattern
- API routes/lists.ts: let → const for updateValues
- API tests: remove unused imports (beforeEach, eq, vi); rename unused vars
with _ prefix; remove unused lastActiveId assignment
- PWA components: void navigate() and void queryClient.invalidateQueries() on
all fire-and-forget call sites; fix CalendarShell explicit-type-casts;
Couldn't → HTML entity
- PWA test files: as unknown as Response for partial mock objects; string | null
type annotation on mockLastSyncedUid; remove async from test callbacks without
await; act(() => {}) not await act(async () => {}) for sync ops
- sw.ts: restructure Notification.data?.url access as let+if so disable
comments land on the exact violation lines; void self.skipWaiting()
This commit is contained in:
@@ -53,7 +53,7 @@ class MockEventSource {
|
||||
constructor(url: string, init?: { withCredentials?: boolean }) {
|
||||
this.url = url
|
||||
this.withCredentials = init?.withCredentials ?? false
|
||||
mockInstances.push(this as unknown as MockEventSourceInstance)
|
||||
mockInstances.push(this)
|
||||
}
|
||||
|
||||
addEventListener(type: string, handler: (ev: MessageEvent) => void) {
|
||||
|
||||
@@ -55,7 +55,8 @@ export function useListSSE({ listId, onStateChange }: UseListSSEOptions): void {
|
||||
|
||||
// handleListChange is stable — invalidate the list on any list-change event
|
||||
const handleListChange = useCallback(() => {
|
||||
queryClient.invalidateQueries({ queryKey: ['list', listId] })
|
||||
// fire-and-forget: cache invalidation; React Query handles the refetch lifecycle
|
||||
void queryClient.invalidateQueries({ queryKey: ['list', listId] })
|
||||
}, [queryClient, listId])
|
||||
|
||||
const connect = useCallback(() => {
|
||||
@@ -76,8 +77,8 @@ export function useListSSE({ listId, onStateChange }: UseListSSEOptions): void {
|
||||
// Reset attempt counter on successful open (D-11)
|
||||
attemptsRef.current = 0
|
||||
onStateChange('connected')
|
||||
// Full refetch on (re)connect — D-10: no Last-Event-ID replay, just refetch
|
||||
queryClient.invalidateQueries({ queryKey: ['list', listId] })
|
||||
// Full refetch on (re)connect — D-10: no Last-Event-ID replay, just refetch; fire-and-forget
|
||||
void queryClient.invalidateQueries({ queryKey: ['list', listId] })
|
||||
}
|
||||
|
||||
es.onerror = () => {
|
||||
|
||||
Reference in New Issue
Block a user