Skip to content

feat(lint/js): add usePromiseRejectErrors - #11838

Merged
dyc3 merged 1 commit into
mainfrom
dyc3/port-prefer-promise-reject-errors
Sep 20, 2026
Merged

dyc3 merged 1 commit into
mainfrom
dyc3/port-prefer-promise-reject-errors

Conversation

@dyc3

@dyc3 dyc3 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds usePromiseRejectErrors, which is a port of https://eslint.org/docs/latest/rules/prefer-promise-reject-errors

Does not include options from the source rule.

implemented by astra

Test Plan

snapshots

Docs

@changeset-bot

changeset-bot Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1ba9e8c

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

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

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

@github-actions github-actions Bot added A-CLI Area: CLI A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Sep 18, 2026
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: biomejs/biome/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: d8c7167d-d203-401d-bc36-28e320b36143

📥 Commits

Reviewing files that changed from the base of the PR and between 3534c7c and 1ba9e8c.

⛔ Files ignored due to path filters (10)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_configuration/src/generated/linter_options_check.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/usePromiseRejectErrors/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/usePromiseRejectErrors/invalid.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/usePromiseRejectErrors/valid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/usePromiseRejectErrors/valid.ts.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (2)
  • crates/biome_js_analyze/src/lint/nursery/use_promise_reject_errors.rs
  • crates/biome_rule_options/src/lib.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

Adds the nursery usePromiseRejectErrors rule. The rule checks global Promise.reject() calls and direct Promise executor rejection callbacks. It reports missing or definitely non-error-like rejection reasons. It analyses nested expressions and TypeScript wrappers, and adds public options, JavaScript and TypeScript fixtures, and a patch changeset.

Suggested reviewers: ematipico

Priority: ⬇️ Low

Change: Feature

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the addition of the usePromiseRejectErrors JavaScript lint rule. It is concise and related to the main change.
Description check ✅ Passed The description explains that the pull request ports ESLint’s prefer-promise-reject-errors rule, excludes source-rule options, and includes snapshot tests. It is directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@codspeed

codspeed Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 5.58%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 73 untouched benchmarks
⏩ 284 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ e2e_no_unresolved_imports 2.4 ms 2.6 ms -5.58%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing dyc3/port-prefer-promise-reject-errors (1ba9e8c) with main (589ca1a)

Open in CodSpeed

Footnotes

  1. 284 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Comment thread crates/biome_js_analyze/src/lint/nursery/use_promise_reject_errors.rs Outdated
@dyc3
dyc3 force-pushed the dyc3/port-prefer-promise-reject-errors branch from 3534c7c to 1ba9e8c Compare September 20, 2026 13:20
@dyc3
dyc3 requested a review from ematipico September 20, 2026 20:49
@dyc3
dyc3 merged commit 9bbff0c into main Sep 20, 2026
36 checks passed
@dyc3
dyc3 deleted the dyc3/port-prefer-promise-reject-errors branch September 20, 2026 21:01
@github-actions github-actions Bot mentioned this pull request Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants