BBC2-34 adopt Biome + scoped ESLint for formatting and architecture rules#12
Merged
b2l merged 3 commits intoApr 15, 2026
Conversation
70978e2 to
7aec1b0
Compare
7aec1b0 to
22f320b
Compare
…ules
Replaces the custom bun-test import walker with two opinionated tools:
* Biome — formatting and general lint. Defaults apply (tab indent,
double quotes, trailing commas), with three rules disabled because
they conflict with legitimate patterns we use:
- `style/noNonNullAssertion` — tests narrow `string | null` after
msw handler mutation; the `!` assertion is correct.
- `suspicious/noExplicitAny` — the Bitbucket response mapping uses
`Record<string, any>` to cross the typed/untyped boundary.
- `suspicious/noControlCharactersInRegex` — the renderer strips
ANSI escapes via `\x1b[...]`, which is the control-char regex
the rule flags.
* ESLint, scoped to `boundaries/dependencies` only. No formatting, no
general lint — Biome covers that. The rule encodes the layering:
- commands may import backend + shared
- backend/<slice> may import shared + same-slice backend
- shared may import shared only
Biome's `files.includes` is whitelist-shaped (src, scripts, root configs)
because `useIgnoreFile: true` didn't reliably exclude .direnv symlinks
into /nix/store or .claude worktrees — an includes list is less
error-prone than chasing exclusions.
One-time format sweep: `biome check --write --unsafe` applied across the
repo. Most auto-fixes were safe (import sorting, template literals,
literal keys). One unsafe rewrite converted `match[1]!.toLowerCase()`
to `match[1]?.toLowerCase()` in repository/{parse-url,resolve}.ts — a
semantic change (non-null assertion → optional chain) — manually
reverted since the `!` was correct given a prior guard.
New scripts: `bun run format` (biome format --write .) and
`bun run lint` (biome check . && eslint src).
Sanity-verified: temporarily added `import type { CurrentUser } from
"../../backend/user/index.ts"` to src/shared/time/index.ts and
confirmed ESLint reports "There is no rule allowing dependencies from
elements of type 'shared' to elements of type 'backend'." Reverted
before commit.
Runs Checked 59 files in 595ms. No fixes applied. (biome check + eslint) before tsc/tests so formatting and architecture violations fail before the more expensive steps.
22f320b to
b4f72b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two problems, one tooling decision:
commands → backend → shareddependency rule.Replaces the earlier custom
bun testwalker with:boundaries/dependenciesrule only. No formatting, no general lint.What changed
biome.json— formatter + linter config, three rules disabled globally for legitimate patterns (see commit for rationale).eslint.config.js— flat config, onlyboundaries/dependenciesrule enabled.package.json— new dev deps (@biomejs/biome,eslint,eslint-plugin-boundaries,@typescript-eslint/parser), new scripts (format,lint).?.rewrites that changed semantics inrepository/{parse-url,resolve}.ts.src/shared/config/index.ts— typedprocexplicitly withBun.Subprocess<"ignore","pipe","pipe">to satisfynoImplicitAnyLet.Why not stay on the custom walker
The
bun testwalker worked, but:Verified
bun test— 128 pass.bunx tsc --noEmit— clean.bun run lint— clean (one harmless deprecation warning from eslint-plugin-boundaries v6 about legacy selector syntax in our config; the rule itself works).shared → backendimport; ESLint correctly reportedThere is no rule allowing dependencies from elements of type "shared" to elements of type "backend".CI wiring
BBC2-41 (not yet merged) adds
bun testto CI. Once that lands, a trivial follow-up will addbun run lintto the CI workflow. Landing either first is fine — the workflow file change is a one-liner.Editor integration
biomehas an LSP; attach vianvim-lspconfig. ESLint likewise viaeslint-lsp/none-ls.Honest caveats
eslint-plugin-boundariesv6 deprecation warning at lint time. Migrating to v6's object-based selector syntax is a follow-up — my attempts hit schema validation errors I didn't fully untangle tonight. Functionally equivalent; just a warning.biome.jsonfiles.includesuses a whitelist shape becauseuseIgnoreFile: truedidn't cleanly exclude.direnv(nix-store symlinks) and.claude/worktrees/. Whitelist is less error-prone than chasing exclusions.