Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .changeset/contributor-14-no-floating-promises-overloads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
"@biomejs/biome": patch
---

Fixed [#9568](https://github.com/biomejs/biome/issues/9568): `noFloatingPromises` now respects adjacent TypeScript overload signatures when matching callback-based calls.

Previously, overloaded helpers could be reported as floating promises whenever any overload returned a `Promise`, even if the selected overload for the current callback returned a synchronous value:

```ts
export function bestEffort<T>(cb: () => Promise<T>): Promise<T | undefined>;
export function bestEffort<T>(cb: () => T): T | undefined;
export function bestEffort<T>(cb: (() => T) | (() => Promise<T>)) {
return cb();
}

bestEffort(() => 1);
```

That synchronous call is no longer flagged, while the async callback overload still reports correctly.
Loading
Loading