Stress testing Biome's noFloatingPromises lint rule
By Steven Van ·
Vercel and Biome turned rule testing into an internal contest, surfacing edge cases like async array maps and PromiseLike return types.
Engineers at Vercel partnered with the Biome team to stress test an updated version of noFloatingPromises, a lint rule that flags Promises created without any code to handle the errors they might throw. Once Biome had an early build of the strengthened rule ready, the two teams turned it into an internal competition: find the trickiest edge cases that could still slip past it.
Two of the cases that came up:
- An array of Promises built with a pattern like [1, 2, 3].map(async (x) => x + 1), where the Promises created inside the array are never stored or awaited and end up floating unnoticed.
- A function typed to return PromiseLike instead of Promise. TypeScript treats PromiseLike as only structurally similar to a real Promise, so the linter doesn't flag it the way it would a function typed to return an actual Promise.
Per the rule's documentation, noFloatingPromises is still part of Biome's experimental nursery group and ships with an unsafe fix that can insert a missing await automatically.