Repository navigation
Conversation
Layer: 1-no-floating-promises
This branch has not been deployed
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
A promise that's neither awaited nor marked as ignored can fail silently, so this turns on
typescript/no-floating-promisesand fixes all 32 places it flags.User-facing: none
voidbeforenavigate(),form.handleSubmit(onSubmit)(),refreshSchema(), andconvertImageToBase64AndSetNewIcon(). These calls already ran fire-and-forget, sovoidonly makes that explicit. A rejection still reports as unhandled, the same as before.createCancelledError.ts:void, notawait. AwaitingcancelQueries()would let the query promise reject before the next line attaches its handler.awaiton 19setItemcalls inlocalDb.test.ts. That makes setup finish before the assertions run.voidon twoonClickhandlers inConnect.test.tsx.Why this rule
It's this week's pick from the rules not yet enabled, ranked by value and sized to one PR:
typescript/no-floating-promisestypescript/no-unsafe-returntypescript/no-unsafe-calltypescript/no-explicit-anyIt catches real bugs, unhandled promises, and its fixes fit one small PR.
Evidence
Before: with the rule on,
vp lintreported 32no-floating-promiseserrors.After:
vp lintreports none. Removing thevoidinRedirect.tsxmakes it fail again.vp checkandvp test(4038 tests) pass. Agent-tested and agent-reviewed.Merge Danger
Door: two-way
Impact: none
Production changes only add
void. A revert restores the old call sites with no data or config impact.Related
🤖 Written by an AI agent on my behalf.