chore: enforce biome via CI, apply baseline format#16
Merged
StefanoGuerrini merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
- Add GitHub Actions workflow (.github/workflows/ci.yml) running biome check + vitest on push to main and on pull_request. - Add `format` and `check` scripts to package.json for local use. - Bump biome.json lineWidth 80 → 100 so the current code passes without re-wrapping, then run `biome check --write` to baseline the formatting (trailing commas, import ordering, 2-space indent across tests/_setup). - Fix latent test assertion in tests/index.test.ts: the POST body check expected `"key1=..."` with surrounding JSON quotes, but the SDK correctly sends the raw string. Assertion now matches behavior. No runtime behavior changes.
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
Formalizes the repo's formatting standard (Biome, already configured but not enforced) and wires it into CI, so future PRs don't accidentally drift (like the unrelated formatting hunks that landed with #14).
.github/workflows/ci.yml) — runsbiome check+vitestonpushtomainand on everypull_request. Uses Node 20 (matchesengines.node) and pnpm 9.4 viapnpm/action-setup.format(biome format --write .) andcheck(biome check .) alongside the existingbuildandtest.lineWidth80 → 100. The currentsrc/index.tshas a few lines in the 82–87 range; 100 avoids re-wrapping the whole file for an arbitrary number and stays compatible with the style used in the merged fix: off-by-one in retryOn — retries: 0 still retries once #14.biome check --write .once to apply the standard (trailing commas, import ordering, 2-space indentation acrosstests/_setup.tswhich had tabs). No runtime changes.Incidental fix
tests/index.test.tshad a latent assertion bug that CI would have flagged on first run: the POST body test expected"\"key1=value1&key2=value2\""(as if JSON-stringified), but the SDK correctly sends the raw string viaString(data)for non-object bodies. Assertion updated to match behavior. No source change.Test plan
pnpm checkpasses locallypnpm test— all 13 tests green (4 files)pnpm build— dist emitted cleanly