Skip to content

build(lint): add Biome and a Lefthook pre-push hook for the hub - #85

Merged
egdev6 merged 6 commits into
mainfrom
chore/biome-lefthook
Nov 21, 2026
Merged

egdev6 merged 6 commits into
mainfrom
chore/biome-lefthook

Conversation

@egdev6

@egdev6 egdev6 commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Linked issue

None: tooling parity with egdev6/quorb#307 (Biome + Lefthook), requested by the maintainer.

Type of change

  • type:bug
  • type:feature
  • type:docs
  • type:refactor
  • type:breaking-change
  • type:chore
  • type:test

Summary

The hub frontend (apps/hub) gets linted and formatted by Biome. A Lefthook pre-push hook runs the same checks locally, and CI runs npx biome ci, so any lint error or unformatted file fails the build. The setup and policy match Quorb.

Changes

Area Change
Tooling (6f81354) Adds Biome 2.6.8 and Lefthook 2.2.2 as exact dev dependencies. apps/hub/biome.json uses Quorb's config: recommended rules, single quotes, line width 160, CSS formatter off, and vcs.root: "../.." because the hub is nested. The root lefthook.yml pre-push hook runs npx biome ci in apps/hub and cargo fmt --all -- --check. New scripts: lint, format, check, check:fix and hooks:install. Adds a CI step in ci.yml, a step in scripts/check.sh, LF rules in .gitattributes, CONTRIBUTING (EN/ES) and the README script rows.
Format (6b6ad4e) Formatting only, 86 files. It is byte-identical to running biome format --write on its parent.
Blame (be62ac8) Adds .git-blame-ignore-revs with the format commit.
Lint (4bc6f35, dff61c4) Fixes all 79 Biome errors: first tests and helpers, then app source. Behavior is unchanged. Hook dependency lists are kept with a justified biome-ignore, and the control-character regexes in the validators are untouched.

Test evidence

  • npx biome ci: 0 errors (226 warnings, which do not fail the check).
  • npm test (594), npx tsc --noEmit, npm run ds:doctor, npm run build and cargo fmt --all -- --check: all pass.
  • Lefthook probe (lefthook run pre-push --force): exit 0 on a clean tree; exit 1 on biome after adding a debugger;.
  • An independent verifier confirmed parity with Quorb (justified differences: nested hub, Cargo workspace at the root), that the lockfile only adds @biomejs/* and lefthook*, and that the lint fixes do not change behavior.

Risks and follow-ups

  • Merge with "Rebase and merge", not squash. Squash would fold the format commit into the lint fixes and the tooling. Merge commits are disabled here, and GitHub's rebase merge rewrites SHAs, so a short follow-up commit will update .git-blame-ignore-revs to the format commit's SHA on main.
  • Open branches. They need to rebase on main and run npm run check:fix to resolve formatting conflicts.
  • Local hook. After merging, run npm run hooks:install once per clone from apps/hub. There is no npm prepare script on purpose.

Review notes

  • What to review. Review 6f81354 and the two lint commits; skip 6b6ad4e (formatting only).
  • Lint suppressions. Every biome-ignore names its rule and a concrete reason.

AI assistance

The el Gentleman harness on Pi drafted this change: tooling, formatting, lint fixes (via a worker) and an independent verifier pass. The maintainer reviews it and carries responsibility for the final decision.

@egdev6 egdev6 added the size:exception Maintainer-approved exception to the PR size budget label Nov 21, 2026
@egdev6
egdev6 merged commit 7186542 into main Nov 21, 2026
0 of 6 checks passed
@egdev6
egdev6 deleted the chore/biome-lefthook branch November 21, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:exception Maintainer-approved exception to the PR size budget

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant