Add .prettierrc to pin prettier formatting settings #197

Closed
opened 2026-09-22 10:03:07 +02:00 by clawbot · 2 comments
Collaborator

Follow-up observed while reviewing #195.

The repo now has a .prettierignore but still no .prettierrc. REPO_POLICIES.md lists .prettierrc among the standard files for repos that carry prettier-formatted assets, and the project has first-party JS under static/js/ that script/fmt formats with npx prettier. Today the only pinned setting is the --tab-width 4 flag hard-coded in script/fmt; everything else falls back to whatever the host prettier version defaults to. That makes formatting non-deterministic across machines and prettier versions (a host-vs-CI prettier difference has already been noted as churn in PR review).

This is hygiene only: prettier is not in the make check / fmt-check gate, so main cannot regress from it. Unmilestoned so it does not gate the 1.1.0 release.

Definition of done

  • Add a root .prettierrc capturing the project prettier settings (at minimum tabWidth: 4, and proseWrap: always for markdown per the shared house style; align with the settings referenced in REPO_POLICIES.md).
  • script/fmt relies on the config file rather than passing --tab-width inline (or, if kept inline, the flag and the config agree).
  • make fmt on a clean tree still produces zero modifications; first-party JS and markdown remain formatted; vendored static/js/alpine.min.js stays byte-identical.
  • Decide whether prettier itself should be pinned (package.json + yarn.lock) or left as a host tool; state the decision in the PR. Full pinning of the JS toolchain (node/prettier via hash-verified nvm) may be split into its own issue if larger.
  • Lands via PR from a feature branch off next.

Model: opus-4-8

Follow-up observed while reviewing https://git.eeqj.de/sneak/upaas/pulls/195. The repo now has a `.prettierignore` but still no `.prettierrc`. `REPO_POLICIES.md` lists `.prettierrc` among the standard files for repos that carry prettier-formatted assets, and the project has first-party JS under `static/js/` that `script/fmt` formats with `npx prettier`. Today the only pinned setting is the `--tab-width 4` flag hard-coded in `script/fmt`; everything else falls back to whatever the host prettier version defaults to. That makes formatting non-deterministic across machines and prettier versions (a host-vs-CI prettier difference has already been noted as churn in PR review). This is hygiene only: prettier is not in the `make check` / `fmt-check` gate, so `main` cannot regress from it. Unmilestoned so it does not gate the 1.1.0 release. ## Definition of done - Add a root `.prettierrc` capturing the project prettier settings (at minimum `tabWidth: 4`, and `proseWrap: always` for markdown per the shared house style; align with the settings referenced in `REPO_POLICIES.md`). - `script/fmt` relies on the config file rather than passing `--tab-width` inline (or, if kept inline, the flag and the config agree). - `make fmt` on a clean tree still produces zero modifications; first-party JS and markdown remain formatted; vendored `static/js/alpine.min.js` stays byte-identical. - Decide whether prettier itself should be pinned (package.json + yarn.lock) or left as a host tool; state the decision in the PR. Full pinning of the JS toolchain (node/prettier via hash-verified nvm) may be split into its own issue if larger. - Lands via PR from a feature branch off `next`. Model: opus-4-8
Author
Collaborator

Opened #202 (base next).

Added a root .prettierrc (JSON: tabWidth: 4, proseWrap: always) and removed the redundant inline --tab-width 4 from script/fmt, so the config file is the single source of truth. make fmt on a clean tree is a no-op (JS unchanged, vendored alpine.min.js untouched via .prettierignore); make check passes.

script/fmt runs prettier only on static/js/*.js, so markdown formatting was not added to the tooling — that would reflow every .md file and break the zero-modification requirement. Prettier left as a host tool (no package.json exists; it is not in the gate, so main cannot regress); full JS-toolchain pinning left to its own issue.

Model: opus-4-8

Opened https://git.eeqj.de/sneak/upaas/pulls/202 (base `next`). Added a root `.prettierrc` (JSON: `tabWidth: 4`, `proseWrap: always`) and removed the redundant inline `--tab-width 4` from `script/fmt`, so the config file is the single source of truth. `make fmt` on a clean tree is a no-op (JS unchanged, vendored `alpine.min.js` untouched via `.prettierignore`); `make check` passes. `script/fmt` runs prettier only on `static/js/*.js`, so markdown formatting was not added to the tooling — that would reflow every `.md` file and break the zero-modification requirement. Prettier left as a host tool (no `package.json` exists; it is not in the gate, so `main` cannot regress); full JS-toolchain pinning left to its own issue. Model: opus-4-8
Author
Collaborator

Closing as superseded by #203. The DoD here (deterministic prettier) is correct, but the fix is to vendor the canonical .prettierrc and pinned prettier toolchain from the sneak/prompts scaffold rather than hand-author a repo-local config; #203 carries that scope.

Model: opus-4-8

Closing as superseded by https://git.eeqj.de/sneak/upaas/issues/203. The DoD here (deterministic prettier) is correct, but the fix is to vendor the canonical `.prettierrc` and pinned prettier toolchain from the `sneak/prompts` scaffold rather than hand-author a repo-local config; #203 carries that scope. Model: opus-4-8
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/upaas#197