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:
@@ -16,41 +16,41 @@ autonomous: true
|
||||
requirements: []
|
||||
must_haves:
|
||||
truths:
|
||||
- "ESLint flat config exists at repo root and loads without error (D-13-01: typescript-eslint recommendedTypeChecked via projectService:true; D-13-03: no strict/strictTypeChecked presets)"
|
||||
- "React + react-hooks rules apply ONLY to apps/pwa/** globs; apps/api receives no React config (D-13-02)"
|
||||
- "Every package lint invocation bakes --max-warnings 0 so any warning fails (D-13-04)"
|
||||
- "Lint covers app src/, vitest tests, Playwright e2e specs, and config files (D-13-09); config + apps/api/tests files get a disableTypeChecked override so type-aware linting does not error on out-of-project files (D-13-10)"
|
||||
- "Prettier is wired as a standalone gate (format / format:check scripts) with eslint-config-prettier/flat imported LAST in the flat config to disable conflicting formatting rules (D-13-07)"
|
||||
- "Running `pnpm lint` on an introduced deliberate violation exits non-zero (SC-1); the throwaway file is deleted and never committed"
|
||||
- "Running `pnpm format:check` on an introduced unformatted file exits non-zero (SC-1); the throwaway file is deleted and never committed"
|
||||
- 'ESLint flat config exists at repo root and loads without error (D-13-01: typescript-eslint recommendedTypeChecked via projectService:true; D-13-03: no strict/strictTypeChecked presets)'
|
||||
- 'React + react-hooks rules apply ONLY to apps/pwa/** globs; apps/api receives no React config (D-13-02)'
|
||||
- 'Every package lint invocation bakes --max-warnings 0 so any warning fails (D-13-04)'
|
||||
- 'Lint covers app src/, vitest tests, Playwright e2e specs, and config files (D-13-09); config + apps/api/tests files get a disableTypeChecked override so type-aware linting does not error on out-of-project files (D-13-10)'
|
||||
- 'Prettier is wired as a standalone gate (format / format:check scripts) with eslint-config-prettier/flat imported LAST in the flat config to disable conflicting formatting rules (D-13-07)'
|
||||
- 'Running `pnpm lint` on an introduced deliberate violation exits non-zero (SC-1); the throwaway file is deleted and never committed'
|
||||
- 'Running `pnpm format:check` on an introduced unformatted file exits non-zero (SC-1); the throwaway file is deleted and never committed'
|
||||
artifacts:
|
||||
- path: "eslint.config.js"
|
||||
provides: "Root flat ESLint config: base type-aware block, pwa-react block, disableTypeChecked override block, prettier-last"
|
||||
contains: "recommendedTypeChecked"
|
||||
- path: 'eslint.config.js'
|
||||
provides: 'Root flat ESLint config: base type-aware block, pwa-react block, disableTypeChecked override block, prettier-last'
|
||||
contains: 'recommendedTypeChecked'
|
||||
min_lines: 40
|
||||
- path: ".prettierrc"
|
||||
provides: "Prettier defaults matching existing single-quote codebase style"
|
||||
contains: "singleQuote"
|
||||
- path: ".prettierignore"
|
||||
provides: "Prettier excludes (dist, node_modules, lockfile, generated migrations, html)"
|
||||
- path: "package.json"
|
||||
provides: "Root type:module + format/format:check scripts"
|
||||
contains: "format:check"
|
||||
- path: "apps/api/package.json"
|
||||
provides: "api lint script mirroring typecheck idiom"
|
||||
contains: "--max-warnings 0"
|
||||
- path: "apps/pwa/package.json"
|
||||
provides: "pwa lint script mirroring typecheck idiom"
|
||||
contains: "--max-warnings 0"
|
||||
- path: '.prettierrc'
|
||||
provides: 'Prettier defaults matching existing single-quote codebase style'
|
||||
contains: 'singleQuote'
|
||||
- path: '.prettierignore'
|
||||
provides: 'Prettier excludes (dist, node_modules, lockfile, generated migrations, html)'
|
||||
- path: 'package.json'
|
||||
provides: 'Root type:module + format/format:check scripts'
|
||||
contains: 'format:check'
|
||||
- path: 'apps/api/package.json'
|
||||
provides: 'api lint script mirroring typecheck idiom'
|
||||
contains: '--max-warnings 0'
|
||||
- path: 'apps/pwa/package.json'
|
||||
provides: 'pwa lint script mirroring typecheck idiom'
|
||||
contains: '--max-warnings 0'
|
||||
key_links:
|
||||
- from: "package.json (root lint script)"
|
||||
to: "apps/api/package.json + apps/pwa/package.json lint scripts"
|
||||
via: "pnpm -r --if-present lint"
|
||||
pattern: "pnpm -r --if-present lint"
|
||||
- from: "eslint.config.js"
|
||||
to: "apps/api/tsconfig.json + apps/pwa/tsconfig.json + apps/pwa/tsconfig.e2e.json"
|
||||
via: "parserOptions.projectService:true + tsconfigRootDir"
|
||||
pattern: "projectService"
|
||||
- from: 'package.json (root lint script)'
|
||||
to: 'apps/api/package.json + apps/pwa/package.json lint scripts'
|
||||
via: 'pnpm -r --if-present lint'
|
||||
pattern: 'pnpm -r --if-present lint'
|
||||
- from: 'eslint.config.js'
|
||||
to: 'apps/api/tsconfig.json + apps/pwa/tsconfig.json + apps/pwa/tsconfig.e2e.json'
|
||||
via: 'parserOptions.projectService:true + tsconfigRootDir'
|
||||
pattern: 'projectService'
|
||||
---
|
||||
|
||||
<objective>
|
||||
@@ -77,6 +77,7 @@ Output: eslint.config.js, .prettierrc, .prettierignore, root + per-package scrip
|
||||
@.planning/phases/13-real-lint-gate-eslint/13-VALIDATION.md
|
||||
|
||||
# Files this plan reads/edits:
|
||||
|
||||
@package.json
|
||||
@apps/api/package.json
|
||||
@apps/pwa/package.json
|
||||
@@ -87,11 +88,13 @@ Output: eslint.config.js, .prettierrc, .prettierignore, root + per-package scrip
|
||||
|
||||
<artifacts_this_phase_produces>
|
||||
New files created in THIS plan:
|
||||
|
||||
- `eslint.config.js` (root, ESM flat config)
|
||||
- `.prettierrc` (root)
|
||||
- `.prettierignore` (root)
|
||||
|
||||
New scripts added in THIS plan:
|
||||
|
||||
- root `package.json`: `format`, `format:check`, plus `"type": "module"`
|
||||
- `apps/api/package.json`: `lint`
|
||||
- `apps/pwa/package.json`: `lint`
|
||||
@@ -132,6 +135,7 @@ Downstream (later plans): Plan 02 fixes the violations this config surfaces; Pla
|
||||
- root package.json: `"format": "prettier --write ."`, `"format:check": "prettier --check ."`. Leave the existing root `"lint": "pnpm -r --if-present lint"` unchanged (it auto-activates once the package lint scripts below exist).
|
||||
- apps/api/package.json: `"lint": "eslint src/ tests/ --max-warnings 0"` (mirror the existing `typecheck` script style: single command, directory-scoped, no wrappers). `--max-warnings 0` per D-13-04.
|
||||
- apps/pwa/package.json: `"lint": "eslint src/ e2e/ --max-warnings 0"`. e2e/ is covered by tsconfig.e2e.json which projectService discovers automatically.
|
||||
|
||||
</action>
|
||||
<verify>
|
||||
<automated>cd /home/luc/Projects/familysync && node -e "import('eslint').then(()=>console.log('eslint loads'))" && grep -q "recommendedTypeChecked" eslint.config.js && grep -q "projectService" eslint.config.js && grep -q "disableTypeChecked" eslint.config.js && grep -q "eslint-config-prettier/flat" eslint.config.js && grep -q "apps/pwa/\*\*" eslint.config.js && grep -q "apps/api/tests" eslint.config.js && grep -q '"type": *"module"' package.json && grep -q "singleQuote" .prettierrc && grep -q -- "--max-warnings 0" apps/api/package.json && grep -q -- "--max-warnings 0" apps/pwa/package.json && grep -q "format:check" package.json && echo ALL_CONFIG_PRESENT</automated>
|
||||
@@ -160,6 +164,7 @@ Downstream (later plans): Plan 02 fixes the violations this config surfaces; Pla
|
||||
3. Delete `_format-gate-test.ts`.
|
||||
|
||||
HARD RULE: both throwaway files are deleted in this task. Do NOT `git add` them. The SUMMARY must record both exit codes observed (non-zero) as evidence for SC-1. Do not attempt to make the whole `pnpm lint` exit 0 here — that is Plan 02's job.
|
||||
|
||||
</action>
|
||||
<verify>
|
||||
<automated>cd /home/luc/Projects/familysync && test ! -e apps/api/src/_lint-gate-test.ts && test ! -e _format-gate-test.ts && ! git ls-files --error-unmatch apps/api/src/_lint-gate-test.ts 2>/dev/null && ! git ls-files --error-unmatch _format-gate-test.ts 2>/dev/null && echo THROWAWAYS_ABSENT_AND_UNTRACKED</automated>
|
||||
@@ -170,20 +175,22 @@ Downstream (later plans): Plan 02 fixes the violations this config surfaces; Pla
|
||||
</tasks>
|
||||
|
||||
<threat_model>
|
||||
|
||||
## Trust Boundaries
|
||||
|
||||
| Boundary | Description |
|
||||
|----------|-------------|
|
||||
| Boundary | Description |
|
||||
| ----------------------------------- | ------------------------------------------------------------------------------- |
|
||||
| npm registry → repo devDependencies | New dev-tooling packages (eslint et al.) enter the supply chain at install time |
|
||||
|
||||
This is a dev-tooling-only phase: no runtime, network, auth, or user-data surface is touched. STRIDE surface is limited to supply-chain (Tampering) at install time.
|
||||
|
||||
## STRIDE Threat Register
|
||||
|
||||
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|
||||
|-----------|----------|-----------|-------------|-----------------|
|
||||
| T-13-SC | Tampering | pnpm devDependency installs (eslint, typescript-eslint, eslint-plugin-react, eslint-plugin-react-hooks, eslint-config-prettier, prettier) | accept | RESEARCH.md Package Legitimacy Audit ran the gate: all 7 packages map to canonical official GitHub repos with tens/hundreds of millions of weekly downloads; none flagged SLOP; no postinstall scripts; three SUS-flagged only on a too-new-release signal and explicitly approved (no human checkpoint required). Versions pinned exactly. |
|
||||
| T-13-01 | Tampering | flat config formatting-rule conflict | mitigate | Import `eslint-config-prettier/flat` LAST (D-13-07, Pitfall 7) so ESLint never re-reports formatting that Prettier owns — prevents a fix/format feedback loop. Verified by grep gate. |
|
||||
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|
||||
| --------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| T-13-SC | Tampering | pnpm devDependency installs (eslint, typescript-eslint, eslint-plugin-react, eslint-plugin-react-hooks, eslint-config-prettier, prettier) | accept | RESEARCH.md Package Legitimacy Audit ran the gate: all 7 packages map to canonical official GitHub repos with tens/hundreds of millions of weekly downloads; none flagged SLOP; no postinstall scripts; three SUS-flagged only on a too-new-release signal and explicitly approved (no human checkpoint required). Versions pinned exactly. |
|
||||
| T-13-01 | Tampering | flat config formatting-rule conflict | mitigate | Import `eslint-config-prettier/flat` LAST (D-13-07, Pitfall 7) so ESLint never re-reports formatting that Prettier owns — prevents a fix/format feedback loop. Verified by grep gate. |
|
||||
|
||||
</threat_model>
|
||||
|
||||
<verification>
|
||||
@@ -194,13 +201,14 @@ This is a dev-tooling-only phase: no runtime, network, auth, or user-data surfac
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- ESLint flat config loads without error and is structured exactly per RESEARCH Pattern 1 (covers D-13-01/02/03/04/07/09/10).
|
||||
- Prettier config + scripts wired; root is `type: module`.
|
||||
- `pnpm lint` is now a REAL gate that fails on a deliberate violation (SC-1, lint half).
|
||||
- `pnpm format:check` fails on a deliberate unformatted file (SC-1, format half).
|
||||
- No throwaway test files committed.
|
||||
- (Out of scope here: making the whole repo lint/format-clean — that is Plans 02 and 03.)
|
||||
</success_criteria>
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
Create `.planning/phases/13-real-lint-gate-eslint/13-01-SUMMARY.md` when done. Record: pinned versions actually installed, the SC-1 lint and format:check exit codes observed, and an inventory of the violation classes `pnpm lint` reported across both apps (counts per rule) — Plan 02 consumes this inventory to scope the fixes.
|
||||
|
||||
Reference in New Issue
Block a user