Skip to content

Add Prettier for code formatting - #129

Merged
finnar-bin merged 2 commits into
mainfrom
chore/127-add-prettier
Sep 2, 2026
Merged

Add Prettier for code formatting#129
finnar-bin merged 2 commits into
mainfrom
chore/127-add-prettier

Conversation

@finnar-bin

@finnar-bin finnar-bin commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Resolves #127

Summary

  • Adds Prettier as a devDependency using its default configuration only — no .prettierrc is included. This is intentional: the issue calls for matching manager-ui's zero-decision setup, so there's no repo-specific config to diverge from.
  • Adds format / format:check npm scripts and a .prettierignore scoped to src/**/*.{ts,tsx}.
  • Adds a husky + pretty-quick --staged pre-commit hook so new commits auto-format and can't drift out of style again. The prepare script is husky || true (not plain husky) — this is husky's own documented pattern so that npm ci --omit=dev (production/CI installs without devDependencies) doesn't fail with "husky: not found".
  • One-time mechanical reformat of 47 files under src/ via npx prettier --write "src/**/*.{ts,tsx}" — no logic changes. This is deliberately its own commit (ecad319), separate from the tooling commit (99ccfd9) that adds Prettier itself, so the reformat diff doesn't get tangled up with the tooling/config changes during review (this was itself an acceptance criterion on the issue).
  • Updates CLAUDE.md to document the new formatting tooling.

Out of scope

  • CI wiringformat:check is not wired into any CI workflow here. That's intentionally deferred to a separate issue covering the CI build/typecheck gate.
  • ESLint — no ESLint rules were added or changed for formatting concerns; Prettier owns formatting only.

Test plan

  • npm run format:check exits clean on this branch
  • npx tsc --noEmit passes clean (confirms the mechanical reformat introduced no type errors)
  • Stage an intentionally unformatted file and confirm the pre-commit hook (husky + pretty-quick) auto-formats it before commit
  • npm ci --omit=dev does not fail on the prepare script (husky guard)

Notes

Pure formatting + build-tooling change — no visual or runtime behavior change, so no screenshots are included.

finnar-bin and others added 2 commits September 2, 2026 10:49
One-time reformat prior to wiring up Prettier tooling, kept isolated
from the tooling change so this diff is pure formatting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds Prettier (defaults only, no .prettierrc) scoped to src/**/*.{ts,tsx}
via .prettierignore, with format/format:check npm scripts. Wires up
husky + pretty-quick to auto-format staged files on commit, matching
manager-ui's pattern. The husky prepare script is guarded with
`|| true` so npm ci --omit=dev doesn't fail when husky isn't installed.

Resolves #127

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@finnar-bin finnar-bin added the enhancement New feature or request label Sep 2, 2026
@finnar-bin finnar-bin self-assigned this Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Code Review — ✅ No blockers

@finnar-bin finnar-bin changed the title Material: Add Prettier for code formatting Add Prettier for code formatting Sep 2, 2026
@finnar-bin
finnar-bin merged commit 0fb0efd into main Sep 2, 2026
1 check passed
@finnar-bin
finnar-bin deleted the chore/127-add-prettier branch September 2, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Prettier for code formatting

2 participants