Skip to content

feat(linter): handle arrays of Promises in noFloatingPromises#6512

Merged
arendjr merged 2 commits intobiomejs:nextfrom
arendjr:handle-promise-arrays
Jun 24, 2025
Merged

feat(linter): handle arrays of Promises in noFloatingPromises#6512
arendjr merged 2 commits intobiomejs:nextfrom
arendjr:handle-promise-arrays

Conversation

@arendjr
Copy link
Copy Markdown
Contributor

@arendjr arendjr commented Jun 23, 2025

Summary

Implements handling of arrays with Promises in noFloatingPromises. While this involves some extension of the rule itself, with specialised diagnostics and fixer in case an array of Promises is detected, the tricky part was in the detection of such arrays itself. Specifically, we want to detect cases where we take an array and call .map() with a callback that returns a Promise, which involved handling of slightly more advanced generics cases than we'd seen so far.

Test Plan

Test cases added.

@arendjr arendjr added this to the Biome 2.1 milestone Jun 23, 2025
@arendjr arendjr requested review from a team June 23, 2025 20:00
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 23, 2025

🦋 Changeset detected

Latest commit: 283e65d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@biomejs/biome Minor
@biomejs/cli-darwin-arm64 Minor
@biomejs/cli-darwin-x64 Minor
@biomejs/cli-linux-arm64-musl Minor
@biomejs/cli-linux-arm64 Minor
@biomejs/cli-linux-x64-musl Minor
@biomejs/cli-linux-x64 Minor
@biomejs/cli-win32-arm64 Minor
@biomejs/cli-win32-x64 Minor
@biomejs/wasm-bundler Minor
@biomejs/wasm-nodejs Minor
@biomejs/wasm-web Minor
@biomejs/backend-jsonrpc Patch
@biomejs/js-api Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@arendjr arendjr added A-Linter Area: linter A-Type-Inference Area: type inference labels Jun 23, 2025
@github-actions github-actions Bot added A-Project Area: project L-JavaScript Language: JavaScript and super languages labels Jun 23, 2025
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 23, 2025

CodSpeed Performance Report

Merging #6512 will create unknown performance changes

Comparing arendjr:handle-promise-arrays (283e65d) with next (c8c738e)

Summary

🆕 115 new benchmarks
⁉️ 95 dropped benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 deserialize_from_json_str[biome.json] N/A 361.8 µs N/A
🆕 css_analyzer[bootstrap_18416142857265205439.css] N/A 487.6 ms N/A
🆕 css_analyzer[bulma_5641719244145477318.css] N/A 1.1 s N/A
🆕 css_analyzer[foundation_11602414662825430680.css] N/A 177.2 ms N/A
🆕 css_analyzer[pure_9395922602181450299.css] N/A 18.9 ms N/A
🆕 css_analyzer[tachyons_11778168428173736564.css] N/A 133.2 ms N/A
🆕 css_formatter[bootstrap_18416142857265205439.css] N/A 115.7 ms N/A
🆕 css_formatter[bulma_5641719244145477318.css] N/A 366.8 ms N/A
🆕 css_formatter[foundation_11602414662825430680.css] N/A 76.8 ms N/A
🆕 css_formatter[full_5814491140539129161.css] N/A 1.3 s N/A
🆕 css_formatter[materialize_5526761731747548557.css] N/A 83.4 ms N/A
🆕 css_formatter[pure_9395922602181450299.css] N/A 9.6 ms N/A
🆕 css_formatter[semantic_4685287698740288120.css] N/A 367.4 ms N/A
🆕 css_formatter[tachyons_11778168428173736564.css] N/A 36.9 ms N/A
🆕 bootstrap_18416142857265205439.css[cached] N/A 35.7 ms N/A
🆕 bootstrap_18416142857265205439.css[uncached] N/A 39.1 ms N/A
🆕 bulma_5641719244145477318.css[cached] N/A 109.2 ms N/A
🆕 bulma_5641719244145477318.css[uncached] N/A 119 ms N/A
🆕 foundation_11602414662825430680.css[cached] N/A 23 ms N/A
🆕 foundation_11602414662825430680.css[uncached] N/A 24.8 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@arendjr arendjr removed this from the Biome 2.1 milestone Jun 24, 2025
@arendjr arendjr merged commit 0c0bf82 into biomejs:next Jun 24, 2025
26 of 27 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter A-Project Area: project A-Type-Inference Area: type inference L-JavaScript Language: JavaScript and super languages

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant