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:
Lucas Berger
2026-06-11 20:23:38 -04:00
parent 39e26561cf
commit 03e953158a
31 changed files with 176 additions and 121 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
* 3. NODE_ENV!='production' + DEV_AUTH_BYPASS='true' → DEV_USER injected into context
*/
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
import { describe, it, expect, afterEach } from 'vitest'
import { Hono } from 'hono'
// We import after env manipulation since devAuthBypass() reads env vars at call time.
+3 -3
View File
@@ -32,7 +32,7 @@ const mockCredentialsSelectResult: Array<{
// Each call to db.select() needs to return different chains
// We use a call counter to decide which data to return
let selectCallCount = 0
let _callCount = 0
const mockSelectLimit = vi.fn()
const mockSelectWhere = vi.fn().mockReturnValue({ limit: mockSelectLimit })
@@ -44,7 +44,7 @@ mockSelectFrom.mockImplementation(() => ({
where: mockSelectWhere,
// Support both: direct await (no where) and .where().limit()
then: (resolve: (v: typeof mockCredentialsSelectResult) => void) => {
selectCallCount++
_callCount++
resolve(mockCredentialsSelectResult)
return Promise.resolve(mockCredentialsSelectResult)
},
@@ -71,7 +71,7 @@ vi.mock('../../src/broker/client.js', () => ({
describe('broker poller — runPoll', () => {
beforeEach(() => {
vi.clearAllMocks()
selectCallCount = 0
_callCount = 0
// Reset implementations
mockSyncCalendar.mockResolvedValue(undefined)
+1 -1
View File
@@ -518,7 +518,7 @@ describe('GET /api/events/sync-status', () => {
const mockOrderBy = vi.fn().mockImplementation(() => Promise.resolve(mockDbRows))
const mockLimit = vi.fn().mockReturnValue(mockOrderBy)
const mockSimpleWhere = vi.fn().mockReturnValue({ limit: mockLimit })
const mockOrderByDirect = vi.fn().mockImplementation(() => Promise.resolve(mockDbRows))
const _mockOrderByDirect = vi.fn().mockImplementation(() => Promise.resolve(mockDbRows))
// Some implementations use .where().orderBy() or just .where()
mockSimpleWhere.mockReturnValue({ limit: mockLimit, orderBy: vi.fn().mockReturnValue({ limit: vi.fn().mockResolvedValue(mockDbRows) }) })
mockFromFn.mockReturnValue({ where: mockSimpleWhere })
+3 -4
View File
@@ -510,7 +510,6 @@ async function seedItem(
rank: string,
checked = false,
): Promise<number> {
const { eq } = await import('drizzle-orm')
const [result] = await db.insert(listItems).values({ listId, text, rank, checked }).$returningId()
return result.id
}
@@ -646,7 +645,7 @@ describe('PATCH /api/list-items/:id — per-field LWW (D-08)', () => {
const listId = await seedList(ownerId, 'Uncheck Rank', false)
// Two active items
await seedItem(listId, 'alpha', 'a0')
const lastActiveId = await seedItem(listId, 'beta', 'a1')
await seedItem(listId, 'beta', 'a1')
// One checked item (to uncheck)
const checkedItemId = await seedItem(listId, 'checked-one', 'Zz', true)
@@ -1055,8 +1054,8 @@ describe('PATCH /api/list-items/:id { position } — reorder ordering (LIST-03,
const ownerId = await seedUser('reorder-lww')
currentDevUserId = ownerId
const listId = await seedList(ownerId, 'Reorder LWW', false)
const id1 = await seedItem(listId, 'alpha', 'a0')
const id2 = await seedItem(listId, 'beta', 'a1')
const _id1 = await seedItem(listId, 'alpha', 'a0')
const _id2 = await seedItem(listId, 'beta', 'a1')
const id3 = await seedItem(listId, 'gamma', 'a2')
const app = await getApp()