chore(tooling): pin/reconcile Prettier so pnpm format doesn't churn unrelated files #393

Open
opened 2026-06-30 12:24:39 +00:00 by james · 0 comments
Owner

Flagged during the data-export PR (#322).

Symptom

Running the repo's format script (prettier --write .) reformatted ~130 unrelated files because the locally-resolved Prettier (3.8.4 at the time) diverges from whatever 3.x the repo was last formatted with. The export PR reverted that churn by hand and committed only the intended files. CI does not gate on Prettier today (no format:check in the workflows), so this is a developer-experience papercut, not a build failure — but it makes pnpm format unsafe to run casually.

Work

  • Pin Prettier to an exact version in the workspace (and confirm a single resolved version across the lockfile), then run a one-time prettier --write . as its own isolated commit so the tree matches the pinned formatter.
  • Decide whether to add a format:check CI step (and/or a lefthook pre-commit formatter on staged files) so drift can't silently reaccumulate.
  • Sanity-check interaction with the existing eslint-config-prettier (see #164) so ESLint and Prettier don't fight.

Caveat

Part of the observed divergence may have been a stale sandbox node_modules; confirm the version actually resolved from the lockfile before assuming a real pin gap.

Flagged during the data-export PR (#322). ## Symptom Running the repo's `format` script (`prettier --write .`) reformatted ~130 unrelated files because the locally-resolved Prettier (3.8.4 at the time) diverges from whatever 3.x the repo was last formatted with. The export PR reverted that churn by hand and committed only the intended files. CI does not gate on Prettier today (no `format:check` in the workflows), so this is a developer-experience papercut, not a build failure — but it makes `pnpm format` unsafe to run casually. ## Work - Pin Prettier to an exact version in the workspace (and confirm a single resolved version across the lockfile), then run a one-time `prettier --write .` as its own isolated commit so the tree matches the pinned formatter. - Decide whether to add a `format:check` CI step (and/or a lefthook `pre-commit` formatter on staged files) so drift can't silently reaccumulate. - Sanity-check interaction with the existing `eslint-config-prettier` (see #164) so ESLint and Prettier don't fight. ## Caveat Part of the observed divergence may have been a stale sandbox `node_modules`; confirm the version actually resolved from the lockfile before assuming a real pin gap.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/carol#393
No description provided.