feat(errors): replace silent-catch ratchet with a biome lint rule - #1487
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Is it not possible to completely replace |
Per BYK review feedback on #1487, add the six patterns (and the matching variants) so a silent catch followed by a is still caught. The current tree still has zero silent sites, so the 197 grandfathered suppressions remain valid and lint stays clean.
jared-outpost
Bot
force-pushed
the
issue-1472-silent-catch-biome-rule
branch
from
August 26, 2026 12:51
88d1186 to
d3fd85c
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d3fd85c. Configure here.
GritQL type-annotation metavariables don't bind, so the untyped `catch ($e)` patterns missed `catch (e: unknown)` / `catch (e: any)`. TypeScript only permits unknown or any as a catch binding type, so add literal variants for both across the empty / return / return-value forms, with and without finally. The error-forwarding guard is preserved.
5 tasks
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.

Converts the hand-rolled silent-catch detector + ratchet baseline JSON into a Biome GritQL plugin (
lint-rules/no-silent-catch.grit), grandfathering the 197 pre-existing sites with inline// biome-ignore lint/plugincomments instead of a baseline file. The ratchet is preserved: a new silent catch is a plugin error, and removing a grandfathered catch orphans its suppression (suppressions/unused) —pnpm run lintnow runs--error-on-warningsso both fail CI, and the backlog can only shrink.The old
check-error-patterns.tskeeps its ContextError / CliError "Try:" checks; only the silent-catch machinery andsilent-catch-baseline.jsonare removed.Testing
pnpm run lint(with--error-on-warnings): cleanpnpm run check:errors: cleanvitest run test/script/check-error-patterns.test.ts test/script/no-silent-catch.test.ts: 12 passingsuppressions/unusedCloses #1472