style(13-03): apply Prettier formatting across repo

Mechanical reformat — no logic changes. 398 files changed, 19125
insertions(+), 16457 deletions(-). Prettier 3.8.4 with .prettierrc
(singleQuote:true, semi:true, tabWidth:2, trailingComma:all,
printWidth:100). Isolated per D-13-08 for reviewability.
This commit is contained in:
Lucas Berger
2026-06-11 20:35:18 -04:00
parent 4bc0445173
commit 982438dc10
398 changed files with 19050 additions and 16382 deletions
@@ -1,6 +1,6 @@
---
phase: 13-real-lint-gate-eslint
plan: "02"
plan: '02'
subsystem: lint-gate
tags: [eslint, typescript-eslint, react-hooks, lint-fix, type-safety]
dependency_graph:
@@ -44,11 +44,11 @@ key_files:
- apps/pwa/src/routes/ListsIndex.tsx
- apps/pwa/src/sw.ts
decisions:
- "D-13-06 enforced: every eslint-disable carries a justifying comment; no blanket suppressions added"
- "React Compiler rules (react-hooks v7 flat.recommended) disabled globally with justification — codebase does not use React Compiler"
- "ical.js unsafe-access handled with targeted no-unsafe-assignment/argument per-line suppression (same idiom as EventForm.tsx:271-275)"
- "void operator applied to queryClient.invalidateQueries and navigate() as legitimate fire-and-forget; broker push/outbox/reminder paths reviewed — no missing awaits found, existing void+catch pattern is correct"
- "as unknown as Response used for partial Response mock objects in client.test.ts (TS2352 fix — not a lint fix but a pre-existing typecheck bug surfaced by verification)"
- 'D-13-06 enforced: every eslint-disable carries a justifying comment; no blanket suppressions added'
- 'React Compiler rules (react-hooks v7 flat.recommended) disabled globally with justification — codebase does not use React Compiler'
- 'ical.js unsafe-access handled with targeted no-unsafe-assignment/argument per-line suppression (same idiom as EventForm.tsx:271-275)'
- 'void operator applied to queryClient.invalidateQueries and navigate() as legitimate fire-and-forget; broker push/outbox/reminder paths reviewed — no missing awaits found, existing void+catch pattern is correct'
- 'as unknown as Response used for partial Response mock objects in client.test.ts (TS2352 fix — not a lint fix but a pre-existing typecheck bug surfaced by verification)'
metrics:
duration_minutes: ~90
completed: 2026-06-11
@@ -66,10 +66,10 @@ ESLint violation elimination across both `apps/api` and `apps/pwa` until `pnpm l
## Tasks Completed
| Task | Description | Commit |
|------|-------------|--------|
| 1 | Fix all API ESLint violations | 03e9531 |
| 2 | Fix all PWA ESLint violations | 03e9531 |
| Task | Description | Commit |
| ---- | ----------------------------- | ------- |
| 1 | Fix all API ESLint violations | 03e9531 |
| 2 | Fix all PWA ESLint violations | 03e9531 |
Both tasks were committed together as a single atomic commit covering 31 files.
@@ -129,36 +129,42 @@ Both tasks were committed together as a single atomic commit covering 31 files.
### Auto-fixed Issues
**1. [Rule 1 - Bug] Unused eslint-disable directives caused by wrong placement**
- **Found during:** Task 1 and 2 (iterative lint runs)
- **Issue:** Disable comments placed on `let` declaration lines were flagged as "unused" because the violations fired on assignment expressions inside try blocks, not on the declarations.
- **Fix:** Moved disables inside the try blocks, on the line immediately before the violating expression.
- **Files:** `sync.ts`, `expand.ts`, `vevent.ts`, `sw.ts`
**2. [Rule 2 - Missing] React Compiler rules not in original violation inventory**
- **Found during:** Task 2 (PWA lint run)
- **Issue:** `react-hooks` v7.1.1 `flat.recommended` enables `set-state-in-effect`, `immutability`, `purity`, `refs-in-dom` etc. — React Compiler rules not in original audit. These fired on valid pre-Compiler React patterns.
- **Fix:** Disabled all Compiler-only rules in eslint.config.js with justification comment.
- **Files:** `eslint.config.js`
**3. [Rule 1 - Bug] TS2352 in client.test.ts (partial Response mocks)**
- **Found during:** Task 3 (typecheck verification)
- **Issue:** `{ ok: true, json: () => ... } as Response` fails tsc strict check — the partial object doesn't sufficiently overlap with `Response`. This was a pre-existing issue surfaced by running typecheck.
- **Fix:** Changed to `as unknown as Response` (double-assert through `unknown` for intentional structural mismatch in test mocks).
- **Files:** `apps/pwa/src/api/client.test.ts` (18 occurrences)
**4. [Rule 1 - Bug] TS2322 in SyncStateToast.test.tsx (null assignment)**
- **Found during:** Task 3 (typecheck verification)
- **Issue:** `mockLastSyncedUid.value` inferred as `string`, but later assigned `null`. Pre-existing tsc error.
- **Fix:** Added `as string | null` type annotation to the initializer.
- **Files:** `apps/pwa/src/components/SyncStateToast.test.tsx`
**5. [Rule 3 - Blocking] e2e files not in projectService**
- **Found during:** Task 2 (PWA lint run)
- **Issue:** `apps/pwa/e2e/*.ts` not in the `projectService` tsconfig scope; eslint reported parsing errors.
- **Fix:** Added them to the `disableTypeChecked` block in `eslint.config.js`.
- **Files:** `eslint.config.js`
**6. [Rule 1 - Bug] await act(sync callback) → await-thenable**
- **Found during:** Task 2 (PWA lint)
- **Issue:** After removing `async` from `act` callbacks (no inner await), the sync `act(() => {})` returns `void`, not a Promise. `await void` triggers `await-thenable`.
- **Fix:** Removed both `async` keyword AND `await` from affected `act(...)` calls in `ListDetail.test.tsx`.
@@ -179,6 +185,7 @@ An independent re-run of `pnpm lint` after the original executor reported exit 0
**Root cause:** The original deviation-4 fix was contradictory — the SUMMARY described removing the `as string | null` assertion AND adding a type annotation, but only the removal was committed (or the removal was not actually staged). The prior execution left the assertion in place.
**Residual error:**
```
apps/pwa/src/components/SyncStateToast.test.tsx:29:31 error
This assertion is unnecessary since the receiver accepts the original type of the expression
@@ -190,6 +197,7 @@ apps/pwa/src/components/SyncStateToast.test.tsx:29:31 error
**Fix applied (commit `3f2e3ea`):** Restructured the `vi.hoisted()` callback from an arrow returning an object literal to a block body with an explicit typed const: `const mockLastSyncedUid: { value: string | null } = { value: 'test-uid-123' }`. This satisfies ESLint (no inline assertion) and tsc (null assignment is type-safe). No eslint-disable required.
**Verified:**
- `pnpm lint` exit 0
- `pnpm typecheck` exit 0
- `pnpm --filter @familysync/pwa test` — 191/191 passing
@@ -197,15 +205,18 @@ apps/pwa/src/components/SyncStateToast.test.tsx:29:31 error
## Self-Check: PASSED
Files verified:
- `eslint.config.js` — present, modified
- `apps/api/src/broker/sync.ts` — present, modified
- `apps/pwa/src/sw.ts` — present, modified
- `apps/pwa/src/routes/ListDetail.test.tsx` — present, modified
Commits verified:
- `03e9531` — present in git log
Final verification:
- `pnpm lint` — exits 0 (both apps clean, --max-warnings 0)
- `pnpm typecheck` — exits 0 (both apps + e2e tsconfig)
- `pnpm --filter @familysync/pwa test` — 191 tests passing