Repository navigation
Add Biome and fix all lint/format issues - #2
Merged
Merged
Conversation
Co-authored-by: Anirudh Kamath <kamath@users.noreply.github.com>
Co-authored-by: Anirudh Kamath <kamath@users.noreply.github.com>
Replace non-null assertions with explicit narrowing, type the CDP accessibility and frame-tree payloads that snapshots read, and route remaining untyped CDP JSON through one documented CdpPayload alias. Add a button type, and split message part rendering so the index key lives in one place. Co-authored-by: Anirudh Kamath <kamath@users.noreply.github.com>
kamath
marked this pull request as ready for review
September 24, 2026 15:13
cursor Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
Main (#2) added Biome with the recommended preset and formatter and reformatted the codebase. Conflicts resolved by normalizing formatting on both sides and three-way merging the content: - biome.json/package.json: main's config and scripts, plus the no-type-assertion plugin. - page.ts: keep main's Quad tuple and area(); derive Quad from a zod tuple schema so the quads cast stays removed. - examples/02-mcp-server: keep main's sessions guard and this branch's sessionId shape narrowing. - tools.test.ts: keep main's non-null-assertion removals, with zod parsing in place of the casts. - api.chat.ts: type `let messages` for noImplicitAnyLet.
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
Adds Biome 2.5 as the repo's linter and formatter and fixes everything it reports. Also adds a CI workflow, so pull requests are linted, built, type-checked, and unit-tested.
Biome runs in three places, and warnings fail all three:
pnpm checkrunspnpm lint(which isbiome check --error-on-warnings .) before type-checking each package.pnpm installthrough simple-git-hooks, runspnpm lint. SetSKIP_SIMPLE_GIT_HOOKS=1to bypass it.CI (
.github/workflows/ci.yml)Runs on pull requests and on pushes to
main, with two parallel jobs:biome(about 7s):biomejs/setup-biomeinstalls the Biome version pinned inpnpm-lock.yaml, then runsbiome ci --error-on-warnings ..check(about 70s):pnpm/setup@v3installs the pnpm version frompackageManagerplus the latest Node 22.x, then runspnpm install --frozen-lockfilewith a cached store. After that it runspnpm build,pnpm -r check, andpnpm test.routeTree.gen.ts, which only the Vite build generates..tsfiles directly, so they need Node 22.18 or newer. Node 22.x satisfies that.Commits
biome.json, root scripts, and a README note.Config choices
worker-configuration.d.tsis excluded because Wrangler generates it (about 15.7k lines).tailwindDirectivesis enabled so@sourceinstyles.cssparses.simple-git-hooksis declined inallowBuilds. Its own postinstall is not needed because the rootpreparescript installs the hook.Hand-written lint fixes
noNonNullAssertion(54): replaced with explicit narrowing. Examples: a type guard forownsSession, tab lookups that check their result, a CDPQuadtuple type, andassert.oknarrowing in tests.noExplicitAny(13): addedAXNodeandFrameTreeNodeinterfaces for the CDP payloads that snapshots read.evaluate,evaluateIn, andLocator.applyare now generic with anunknowndefault. The remaining raw CDP JSON goes through a single documentedCdpPayloadalias.type="button". Message parts render through aMessagePartcomponent, so the index key appears in one place.noAssignInExpressionsandnoImplicitAnyLet.The repo has exactly three
biome-ignorecomments, each with a reason: theCdpPayloadalias, the message part index key, and the scroll effect's trigger dependencies.Two small behavior changes:
tab.closenow throws "No tab is open." instead of crashing onundefined.shutdownskipsbrowser.stopwhen a handle has nosessionId.Testing
checkjob ran 62/62 unit tests.test:runtimepasses andpnpm test:e2epasses 14/14.Not changed
The
enginesfields and the README still say Node 22.13+. That is enough to run pnpm 11, but running the.tssources directly (for examplepnpm testorpnpm cli) needs 22.18+. I left it as is because the published packages may really support 22.13.