Replace jest, eslint, and prettier for consistency w/ other projects#515
Open
jhump wants to merge 5 commits into
Open
Replace jest, eslint, and prettier for consistency w/ other projects#515jhump wants to merge 5 commits into
jhump wants to merge 5 commits into
Conversation
Run tests with node:test via the tsx loader (matching protobuf-es), replacing jest + ts-jest. ts-jest ran transpile-only, so type errors in test files went unnoticed; add a tsc --noEmit typecheck step that covers the tests to close that gap. - Replace jest/ts-jest/@jest/globals with tsx. Rewrite test imports to node:test + node:assert/strict and convert every expect() matcher to assert. - Convert the 9 inline snapshots in gateway/service.test.ts to file-based node:test snapshots (committed service.test.ts.snapshot), and convert the toThrowErrorMatchingInlineSnapshot checks to assert.rejects. - Add tsconfig.test.json and a typecheck task wired into turbo and CI, covering src/**/*.ts (including tests). - Rename src/jest to src/testing now that jest is gone.
Now that test files are type-checked (tsc --noEmit), add a compile-time assertion that the GatewayServiceOptions `methods` option rejects client-streaming and bidi-streaming method names. The @ts-expect-error directives fail the typecheck if the filter (DescMethodUnary | DescMethodServerStreaming) is ever loosened, closing the gap left when UnaryAndServerStreamMethods was removed.
Adopt Biome for both linting and formatting, matching bufbuild/protobuf-es and connectrpc/connect-es, and use @bufbuild/license-header for the license header that eslint-plugin-notice previously enforced. - Add @biomejs/biome 2.x with a biome.json mirroring the sibling rule set, plus @bufbuild/license-header. Remove eslint, typescript-eslint, prettier, eslint-plugin-notice, and the eslint-config-custom workspace package. - Root scripts: lint = biome lint --error-on-warnings, format = biome format --write, license-header; wire the license-header --check into CI. - Apply Biome's safe lint fixes (import type, Array.isArray, Number.isNaN, parseInt radix, arrow functions, literal keys) and reformat. Suppress noExplicitAny in the type-machinery files (scope/client/utils) where the any usage is intentional. Biome's linter is not type-aware, so the type-aware eslint rules (strict-boolean-expressions, no-unnecessary-condition, etc.) are no longer enforced; tsc --noEmit (the typecheck task) still catches type errors.
timostamm
approved these changes
Jun 17, 2026
| "test": "NODE_OPTIONS=--experimental-vm-modules ../../node_modules/.bin/jest", | ||
| "test:watch": "pnpm run build:esm+types --watch & pnpm run test --watchAll", | ||
| "typecheck": "tsc --noEmit -p tsconfig.test.json", | ||
| "test": "tsx --test $(find src -type f -path '*.test.ts')", |
Member
There was a problem hiding this comment.
This could be "test": "tsx --test 'src/**/*.test.ts'",, letting tsx/node expand the glob. All actively versions of Node.js support it. But we should bump the engine min constraint along with this change, and I didn't want to do that. find works well enough here.
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.
This changes the repo over to using Node's builtin test runner, biome, and bufbuild/licenseheader to replace functionality previously provided by jest, eslint, and prettier. This brings it into alignment with bufbuild/protobuf and connectrpc/connect packages.