Skip to content

[repo] Pre-commit hook reformats unrelated files monorepo-wide; validation.ts has committed biome drift on main #373

Description

@duyet

Severity: P2 · Category: DX

Independently hit by four separate agents in one maintenance run, each working around it identically. That makes it a real defect, not noise.

Two compounding problems

1. packages/api/src/lib/validation.ts fails biome check on unmodified main

Reproduce on a clean checkout of main:

bunx biome check packages/api/src/   # exit 1

The only failure is a formatting drift in validation.ts (a WebhookUrlSchema chain). It is already committed on main — verified via git show main:packages/api/src/lib/validation.ts | biome check --stdin-file-path=validation.ts -.

Consequence: the verification command documented in CLAUDE.md fails for everyone, on every branch, forever. A failing baseline trains people to ignore lint output — which is exactly how the next real failure gets missed.

2. The pre-commit hook is not scoped to staged files

It runs bunx biome check --write packages/*/src/ across the entire monorepo on every commit, regardless of what was staged. Combined with (1), every commit anywhere in the repo silently pulls a validation.ts reformat into the working tree.

Four agents each independently had to git checkout -- packages/api/src/lib/validation.ts after every commit to keep it out of their diff. Anyone who does not notice ships an unrelated file in their PR.

It also surfaces ~35 unrelated pre-existing dashboard warnings (unused imports/vars in MarketingLayout.astro, RootLayout.astro, brand.astro), making the hook noisy for everyone.

Fix

  1. Commit the validation.ts formatting fix so main is green, and add a CI lint gate so the baseline cannot drift again.
  2. Scope the hook to staged files (lint-staged, or biome check --write --staged) so committing never touches unstaged files.
  3. Clear or knowingly ignore the dashboard warnings so the hook's output is signal.

From automated audit 2026-07-17.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions