You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running prettier --write . (or letting an editor format-on-save) from the repo root rewrites thousands of lines of backend source that nothing in CI ever asked to be formatted. It has produced enormous, unreviewable diffs inside otherwise small PRs, repeatedly.
Root cause is a gap, not a bad setting:
Prettier governs exactly three workspaces — apps/loopover-ui (printWidth 100), apps/loopover-miner-ui (printWidth 120), packages/loopover-ui-kit — each with its own format:check, enforced by npm run ui:lint via test:ci.
Everything else (src/**, test/**, scripts/**, the non-UI packages, control-plane/**, review-enrichment/**) is hand-formatted at a much wider effective line length and is not prettier input.
There is no root .prettierrc and no root .prettierignore. Prettier resolves config by walking up from each file, so a root-level run finds nothing, silently falls back to its own defaults (printWidth 80), and rewraps every backend file it is pointed at.
Two secondary faults fall out of the same gap:
packages/loopover-ui-kit has a .prettierignore but no .prettierrc, so it silently runs on prettier's 80-column default while its two sibling workspaces are on 100 and 120. Nothing states this is intentional.
Prettier reads only one ignore file per run — the one for the directory it was invoked from. A root-level run therefore ignores the workspaces' own .prettierignore entries and reformats exactly the files each workspace deliberately exempts: generated output (routeTree.gen.ts, public/openapi.json, src/lib/mcp-tool-reference.ts, .source/**), whose drift checks then fail against a file nobody edited, and content/docs/**, where prettier's mdx pass destroys the embedded YAML indentation inside <CodeBlock code={\...`}>` attributes (the docs(ui): replace 49 hand-rolled docs.*.tsx thin routes with one dynamic docs.$slug.tsx route #8182 fallout, already repaired once).
Deliverables
A root .prettierignore on a default-deny basis (/*, then re-admit the three governed workspaces). An explicit list of excluded trees goes stale the moment a new top-level directory is added and fails open; default-deny fails closed.
Re-state the generated-file and content/docs exemptions in the root ignore, with a comment saying why they cannot be inherited.
Give packages/loopover-ui-kit an explicit .prettierrc pinned to its current effective width, so the setting is stated rather than inherited from a vendor default. Pinning to the current value keeps this change churn-free; unifying the three widths would rewrite 50 of its 64 source files and belongs in its own PR.
Verify by running prettier --write . from the repo root and confirming it is a no-op.
Boundaries
No reformatting of existing code, and no change to which files CI checks. This makes current behavior explicit and unbreakable; it does not change it.
Problem
Running
prettier --write .(or letting an editor format-on-save) from the repo root rewrites thousands of lines of backend source that nothing in CI ever asked to be formatted. It has produced enormous, unreviewable diffs inside otherwise small PRs, repeatedly.Root cause is a gap, not a bad setting:
apps/loopover-ui(printWidth 100),apps/loopover-miner-ui(printWidth 120),packages/loopover-ui-kit— each with its ownformat:check, enforced bynpm run ui:lintviatest:ci.src/**,test/**,scripts/**, the non-UI packages,control-plane/**,review-enrichment/**) is hand-formatted at a much wider effective line length and is not prettier input..prettierrcand no root.prettierignore. Prettier resolves config by walking up from each file, so a root-level run finds nothing, silently falls back to its own defaults (printWidth 80), and rewraps every backend file it is pointed at.Two secondary faults fall out of the same gap:
packages/loopover-ui-kithas a.prettierignorebut no.prettierrc, so it silently runs on prettier's 80-column default while its two sibling workspaces are on 100 and 120. Nothing states this is intentional..prettierignoreentries and reformats exactly the files each workspace deliberately exempts: generated output (routeTree.gen.ts,public/openapi.json,src/lib/mcp-tool-reference.ts,.source/**), whose drift checks then fail against a file nobody edited, andcontent/docs/**, where prettier's mdx pass destroys the embedded YAML indentation inside<CodeBlock code={\...`}>` attributes (the docs(ui): replace 49 hand-rolled docs.*.tsx thin routes with one dynamic docs.$slug.tsx route #8182 fallout, already repaired once).Deliverables
.prettierignoreon a default-deny basis (/*, then re-admit the three governed workspaces). An explicit list of excluded trees goes stale the moment a new top-level directory is added and fails open; default-deny fails closed.content/docsexemptions in the root ignore, with a comment saying why they cannot be inherited.packages/loopover-ui-kitan explicit.prettierrcpinned to its current effective width, so the setting is stated rather than inherited from a vendor default. Pinning to the current value keeps this change churn-free; unifying the three widths would rewrite 50 of its 64 source files and belongs in its own PR.prettier --write .from the repo root and confirming it is a no-op.Boundaries
No reformatting of existing code, and no change to which files CI checks. This makes current behavior explicit and unbreakable; it does not change it.