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.
8.9 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 13-real-lint-gate-eslint | 01 | dev-tooling |
|
|
|
|
|
|
Phase 13 Plan 01: ESLint + Prettier Lint Gate Foundation Summary
Real ESLint flat config (type-aware via projectService) + Prettier installed and wired; both gates proven non-zero on deliberate violations (SC-1).
What Was Built
Task 1: Install devDependencies + author flat config + Prettier config
Installed 7 packages at pinned versions as root devDependencies. Authored eslint.config.js with the required 5-block structure per RESEARCH Pattern 1:
- Global ignores —
**/dist/**,**/node_modules/**,apps/api/src/db/migrations/**,pnpm-lock.yaml - Base block —
apps/**/*.{ts,tsx}, extendsjs.configs.recommended+tseslint.configs.recommendedTypeChecked,parserOptions.projectService: true+tsconfigRootDir: import.meta.dirname,@typescript-eslint/no-unused-varsrule with^_ignore patterns - PWA-React block —
apps/pwa/**/*.{ts,tsx}only, extendsreactPlugin.configs.flat.recommended+reactHooks.configs.flat.recommended,react.version: 'detect',react/prop-types: 'off',react/react-in-jsx-scope: 'off' - disableTypeChecked override — config files (drizzle.config, vitest.config, vite.config, playwright.config) +
apps/api/tests/**/*.ts+eslint.config.jsitself eslint-config-prettier/flatLAST — disables ESLint formatting rules that conflict with Prettier
Added "type": "module" to root package.json (required for eslint.config.js to parse as ESM). Added format/format:check scripts. Added lint script with --max-warnings 0 to both apps/api/package.json and apps/pwa/package.json.
Authored .prettierrc (singleQuote:true, semi:true, tabWidth:2, trailingComma:all, printWidth:100) and .prettierignore.
Commit: df62d33
Task 2: SC-1 smoke proof — deliberate violations, both gates, throwaway cleanup
Lint gate (SC-1 lint half):
- Created
apps/api/src/_lint-gate-test.tswith an unhandledPromise.resolve(1)expression - Ran
pnpm --filter @familysync/api lint→ exit code 1,@typescript-eslint/no-floating-promisesreported on the deliberate file - Deleted
apps/api/src/_lint-gate-test.ts— never staged or committed
Format gate (SC-1 format half):
- Created
_format-gate-test.tsat repo root with double quotes + irregular indentation (opposite of .prettierrc settings) - Ran
pnpm format:check→ exit code 1,_format-gate-test.tslisted in warnings - Deleted
_format-gate-test.ts— never staged or committed
Commit: 7a255ea
Deviations from Plan
Auto-fixed Issues
1. [Rule 1 - Bug] react/react-in-jsx-scope unexpectedly enabled in reactPlugin.configs.flat.recommended
- Found during: Task 2 (SC-1 smoke) — 404
react/react-in-jsx-scopeerrors in the PWA - Issue: RESEARCH.md (Assumption A1, Pitfall 8) stated that
reactPlugin.configs.flat.recommendeddisablesreact/react-in-jsx-scopefor React 17+ JSX transform. In practice,eslint-plugin-react@7.37.5flat.recommended sets this rule to2(error). The PWA usesjsx: "react-jsx"(React 19 automatic transform) —Reactdoes not need to be in scope. - Fix: Added
'react/react-in-jsx-scope': 'off'alongside'react/prop-types': 'off'in the pwa-react config block - Files modified:
eslint.config.js - Commit:
7a255ea
SC-1 Evidence
| Gate | Deliberate Violation | Exit Code | Rule Reported |
|---|---|---|---|
pnpm --filter @familysync/api lint |
Promise.resolve(1) — unhandled promise |
1 (non-zero) | @typescript-eslint/no-floating-promises |
pnpm format:check |
double quotes + irregular indent (opposite of .prettierrc) | 1 (non-zero) | _format-gate-test.ts listed as unformatted |
Both throwaway files confirmed absent and untracked (THROWAWAYS_ABSENT_AND_UNTRACKED).
First-Run Violation Inventory (for Plan 02)
Plan 02 consumes this inventory to scope fixes. No violations were fixed in this plan.
apps/api — 42 errors total
| Rule | Count | Description |
|---|---|---|
@typescript-eslint/no-unnecessary-type-assertion |
24 | Redundant as casts (mainly in outboxWorker.ts dispatcher blocks) |
@typescript-eslint/no-unsafe-assignment |
3 | any assignment from ical.js property access |
@typescript-eslint/no-unsafe-argument |
4 | any args from ical.js property values |
@typescript-eslint/no-unused-vars |
7 | Test file variables assigned but unused |
@typescript-eslint/no-misused-promises |
1 | sse.ts:96 — async callback in void context |
@typescript-eslint/no-base-to-string |
1 | Template literal with possible [object Object] |
@typescript-eslint/restrict-template-expressions |
1 | Record<string, unknown> in template literal |
prefer-const |
1 | lists.ts:604 — let that is never reassigned |
apps/pwa — 77 errors total
| Rule | Count | Description |
|---|---|---|
@typescript-eslint/require-await |
23 | Async functions with no await expression |
@typescript-eslint/no-unnecessary-type-assertion |
14 | Redundant as casts |
@typescript-eslint/no-floating-promises |
11 | Unhandled promises |
@typescript-eslint/no-unused-vars |
4 | Unused variables |
@typescript-eslint/no-unsafe-assignment |
4 | any assignments |
@typescript-eslint/no-unsafe-member-access |
3 | Member access on any |
@typescript-eslint/no-misused-promises |
3 | Async callbacks in void contexts |
react/no-unescaped-entities |
1 | Unescaped ' in JSX |
Total: 119 errors across both apps (0 warnings — --max-warnings 0 working).
Self-Check: PASSED
Created files exist:
eslint.config.js— FOUND.prettierrc— FOUND.prettierignore— FOUND
Commits exist:
df62d33— FOUND (chore(13-01): install ESLint+Prettier, author flat config, wire lint/format scripts)7a255ea— FOUND (fix(13-01): disable react/react-in-jsx-scope for React 19 JSX transform)
Throwaway files absent: THROWAWAYS_ABSENT_AND_UNTRACKED confirmed.