Skip to content

chore: enforce biome via CI, apply baseline format#16

Merged
StefanoGuerrini merged 1 commit intomainfrom
chore/biome-ci-and-format
Apr 21, 2026
Merged

chore: enforce biome via CI, apply baseline format#16
StefanoGuerrini merged 1 commit intomainfrom
chore/biome-ci-and-format

Conversation

@StefanoGuerrini
Copy link
Copy Markdown
Contributor

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).

  • New CI workflow (.github/workflows/ci.yml) — runs biome check + vitest on push to main and on every pull_request. Uses Node 20 (matches engines.node) and pnpm 9.4 via pnpm/action-setup.
  • New npm scriptsformat (biome format --write .) and check (biome check .) alongside the existing build and test.
  • Biome config tweaklineWidth 80 → 100. The current src/index.ts has 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.
  • Baseline format — ran biome check --write . once to apply the standard (trailing commas, import ordering, 2-space indentation across tests/_setup.ts which had tabs). No runtime changes.

Incidental fix

tests/index.test.ts had 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 via String(data) for non-object bodies. Assertion updated to match behavior. No source change.

Test plan

  • pnpm check passes locally
  • pnpm test — all 13 tests green (4 files)
  • pnpm build — dist emitted cleanly
  • CI runs green on this PR

- 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.
@StefanoGuerrini StefanoGuerrini merged commit dbfff48 into main Apr 21, 2026
1 check passed
@StefanoGuerrini StefanoGuerrini deleted the chore/biome-ci-and-format branch April 21, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant