Add .prettierignore for vendored minified JS (closes #185) #195

Merged
clawbot merged 1 commits from fix/prettierignore-vendored-js into next 2026-09-22 10:00:50 +02:00
Collaborator

Fixes #185

script/fmt runs npx prettier --write --tab-width 4 static/js/*.js. With no ignore file, the glob included the vendored, minified static/js/alpine.min.js, so make fmt expanded and rewrote it.

This adds .prettierignore with *.min.js. Verified empirically that prettier honors the ignore file even when files are passed explicitly on the command line, so the glob in script/fmt needed no change.

Definition of done, all met:

  • make fmt on a clean tree now produces zero modifications (git status clean).
  • static/js/alpine.min.js is byte-identical before and after make fmt (sha256 unchanged).
  • First-party JS (dashboard.js, deployment.js, utils.js, and the other non-minified files) is still formatted.

Note: script/fmt-check only checks gofmt; prettier is not in the check gate, so this touches formatting hygiene only, not make check behavior. Host npx prettier is unpinned (3.9.6 here); the DoD holds with it.

Authoritative verification via the Docker build (pinned golangci-lint v2.12.2, Go 1.25): make fmt-check, make lint (0 issues), and make test all ran fresh and passed. Host make check cannot run here: the host has Go 1.26 but the host golangci-lint is built with Go 1.25 and panics loading the 1.26 stdlib.

Model: opus-4-8

Fixes https://git.eeqj.de/sneak/upaas/issues/185 `script/fmt` runs `npx prettier --write --tab-width 4 static/js/*.js`. With no ignore file, the glob included the vendored, minified `static/js/alpine.min.js`, so `make fmt` expanded and rewrote it. This adds `.prettierignore` with `*.min.js`. Verified empirically that prettier honors the ignore file even when files are passed explicitly on the command line, so the glob in `script/fmt` needed no change. Definition of done, all met: - `make fmt` on a clean tree now produces zero modifications (`git status` clean). - `static/js/alpine.min.js` is byte-identical before and after `make fmt` (sha256 unchanged). - First-party JS (`dashboard.js`, `deployment.js`, `utils.js`, and the other non-minified files) is still formatted. Note: `script/fmt-check` only checks `gofmt`; prettier is not in the check gate, so this touches formatting hygiene only, not `make check` behavior. Host `npx prettier` is unpinned (3.9.6 here); the DoD holds with it. Authoritative verification via the Docker build (pinned golangci-lint v2.12.2, Go 1.25): `make fmt-check`, `make lint` (0 issues), and `make test` all ran fresh and passed. Host `make check` cannot run here: the host has Go 1.26 but the host golangci-lint is built with Go 1.25 and panics loading the 1.26 stdlib. Model: opus-4-8
clawbot added 1 commit 2026-09-22 09:38:17 +02:00
script/fmt passes the glob static/js/*.js to prettier, which expanded
and rewrote the vendored static/js/alpine.min.js because there was no
ignore file. Add .prettierignore excluding *.min.js; prettier honors it
even when files are passed explicitly on the command line, so make fmt
now leaves the tree byte-identical while still formatting first-party
JS.

Model: opus-4-8
clawbot self-assigned this 2026-09-22 09:38:26 +02:00
clawbot added the needs-review label 2026-09-22 09:38:26 +02:00
Author
Collaborator

PASS — .prettierignore (*.min.js) at repo root stops make fmt from rewriting the vendored static/js/alpine.min.js: on a clean tree make fmt now yields zero changes, the bundle is byte-identical (verified against an adversarial perturbation, so it is genuinely ignored and not merely already-formatted), first-party JS still reformats, prettier honors the ignore file despite the explicit file glob, and the pinned Docker gate (make fmt-check, lint, test, build) is green on a fresh no-cache run rebased on current next.

Model: opus-4-8

PASS — `.prettierignore` (`*.min.js`) at repo root stops `make fmt` from rewriting the vendored `static/js/alpine.min.js`: on a clean tree `make fmt` now yields zero changes, the bundle is byte-identical (verified against an adversarial perturbation, so it is genuinely ignored and not merely already-formatted), first-party JS still reformats, prettier honors the ignore file despite the explicit file glob, and the pinned Docker gate (`make fmt-check`, `lint`, `test`, `build`) is green on a fresh no-cache run rebased on current `next`. Model: opus-4-8
clawbot merged commit 1d38585431 into next 2026-09-22 10:00:50 +02:00
clawbot deleted branch fix/prettierignore-vendored-js 2026-09-22 10:00:50 +02:00
Sign in to join this conversation.