Skip to content

CI: lint and format checks - #18

Merged
heliocosta-dev merged 1 commit into
mainfrom
ci-lint
Oct 8, 2026
Merged

heliocosta-dev merged 1 commit into
mainfrom
ci-lint

Conversation

@heliocosta-dev

Copy link
Copy Markdown
Member

What CI now runs

A new lint job (Node 22) runs pnpm lint, which is biome check .. It checks:

  • formatting
  • the recommended lint rules, with noExplicitAny as an error
  • import sorting

The existing test job (Node 18/20/22: typecheck, test, build) is unchanged, and both jobs run on every PR.

  • @biomejs/biome is pinned to exactly 2.5.13 (the version the product repo resolves), so Dependabot can bump it.
  • biome.json is a standalone copy of the product repo's settings: 2-space indent, line width 100, double quotes, semicolons, ignore files from .gitignore. It doesn't reference ../millionsend.
  • pnpm lint:fix applies the safe fixes locally.

Code changes to pass the check

The formatter rewrapped lines in 9 files (+153/−37, almost all in test/resources.test.ts), including package.json, where Biome expands arrays the way npm and pnpm write them. Two other edits:

  • src/resources/contacts.ts: one type import's names re-sorted (organizeImports).
  • test/resources.test.ts: expect((calls[0]?.body as unknown[]).length).toBe(2) became expect(calls[0]?.body).toHaveLength(2). It asserts the same thing without tripping noUnsafeOptionalChaining.

Why this is safe:

  • I built dist from main and from this branch. The emitted JS is identical once whitespace is ignored.
  • The .d.ts files are identical apart from that one import order, so the public API is unchanged.
  • Typecheck, the 66 tests and the build pass with pnpm 9.15.9 and --frozen-lockfile.

🤖 Generated with Claude Code

CI gains a lint job on Node 22 that runs `pnpm lint` (`biome check .`):
formatting, the recommended lint rules with noExplicitAny as an error, and
import sorting. Biome is pinned to 2.5.13 and biome.json copies the
product repo's settings (2-space indent, line width 100, double quotes,
semicolons). `pnpm lint:fix` applies the safe fixes locally.

Existing code brought in line: formatter line wrapping in 8 files plus
package.json, one sorted type import, and one test assertion rewritten as
toHaveLength so it no longer trips noUnsafeOptionalChaining. The emitted
JS and type declarations are unchanged apart from that import order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@heliocosta-dev
heliocosta-dev merged commit 946cbf4 into main Oct 8, 2026
4 checks passed
@heliocosta-dev
heliocosta-dev deleted the ci-lint branch October 8, 2026 23:05
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