Skip to content

chore(tooling): adopt Prettier + add CI (format check & typecheck) - #80

Merged
gkhngyk merged 4 commits into
mainfrom
chore/prettier-formatting
May 22, 2026
Merged

gkhngyk merged 4 commits into
mainfrom
chore/prettier-formatting

Conversation

@gkhngyk

@gkhngyk gkhngyk commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adopts Prettier as the project's formatter and adds CI so formatting is enforced automatically. This kills the recurring "noisy diff" problem where a contributor's editor reformats whole files (the exact issue seen in #73): once everyone shares one Prettier config, diffs contain only real changes.

What's included

  • Prettier config (web/.prettierrc.json) — single quotes, printWidth: 100, trailing commas — chosen to match the existing style and minimize churn. .prettierignore skips generated files (e.g. src/types/supabase.ts).
  • ESLint integration — eslint-config-prettier added last in the flat config so ESLint owns code quality and Prettier owns layout (no conflicts).
  • Scripts — yarn format (write) and yarn format:check.
  • CI (.github/workflows/ci.yml) — runs format:check + typecheck on every PR/push to main.
  • Docs — CONTRIBUTING.md notes yarn format + that CI checks it.

Commit structure (review-friendly)

  1. chore(tooling) — config, ESLint integration, scripts, deps, CI (small, reviewable)
  2. style — the one-time prettier --write over web/src (138 files, mechanical, zero logic changes)
  3. chore — .git-blame-ignore-revs so git blame skips the reformat commit
  4. docs(contributing) — the formatting note

Review tip: read commit 1 + 4 for the real change; commit 2 is pure formatting (GitHub honors .git-blame-ignore-revs).

Notes

  • format:check and typecheck both pass locally ✅
  • lint is intentionally not in CI yet — main currently has pre-existing ESLint errors (unrelated to this PR) that would make the gate red. Worth a separate cleanup PR, after which lint can be added to CI.
  • A pre-commit hook (husky + lint-staged) was left out on purpose — the repo root has no package/node_modules, and a broken hook can block local commits. CI already enforces formatting; the hook can be a focused follow-up.

How to use

cd web && yarn format        # format everything
cd web && yarn format:check  # what CI runs

gkhngyk added 4 commits May 22, 2026 19:13
- Prettier config (single quotes, printWidth 100) + ignore for generated files
- eslint-config-prettier so ESLint owns code quality and Prettier owns layout
- format / format:check scripts
- GitHub Actions CI running format:check + typecheck on PRs

The bulk reformat lands in the next commit so this stays reviewable.
Mechanical, formatting-only changes — no logic changes. Recorded in
.git-blame-ignore-revs so git blame skips this commit.
@gkhngyk
gkhngyk merged commit 4d4af69 into main May 22, 2026
3 checks passed
@gkhngyk gkhngyk mentioned this pull request May 26, 2026

This branch was successfully deployed

1 active deployment
Preview — 45bb48c2 Deployed May 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant