Skip to content

Conversation

@lambda47
Copy link
Contributor

Related to #4655

@lambda47 lambda47 requested a review from camc314 as a code owner August 18, 2025 08:47
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 18, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-linter Area - Linter C-enhancement Category - New feature or request labels Aug 18, 2025
@lambda47 lambda47 force-pushed the feature/linter_promise_always-return_rule branch from d0d2276 to b6f8b36 Compare August 18, 2025 08:51
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 18, 2025

CodSpeed Instrumentation Performance Report

Merging #13178 will not alter performance

Comparing lambda47:feature/linter_promise_always-return_rule (40a641f) with main (06ec43c)

Summary

✅ 34 untouched benchmarks

@lambda47 lambda47 force-pushed the feature/linter_promise_always-return_rule branch from b6f8b36 to e3c53b8 Compare August 18, 2025 08:54
@lambda47 lambda47 force-pushed the feature/linter_promise_always-return_rule branch 2 times, most recently from e6b4193 to ddc8c12 Compare August 19, 2025 05:41
@camc314 camc314 requested a review from Copilot August 19, 2025 11:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a new ESLint rule promise/always-return that enforces proper return values in Promise .then() callbacks to prevent broken Promise chains. The rule ensures that each .then() callback either returns a value or throws an exception.

Key Changes:

  • Implements the AlwaysReturn rule with comprehensive logic for analyzing Promise callback control flow
  • Adds configuration options for ignoreLastCallback and ignoreAssignmentVariable settings
  • Includes extensive test coverage with snapshot testing for various Promise chain scenarios

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
crates/oxc_linter/src/rules/promise/always_return.rs Complete implementation of the always-return rule with control flow analysis
crates/oxc_linter/src/snapshots/promise_always_return.snap Snapshot test file containing expected diagnostic outputs
crates/oxc_linter/src/rules.rs Module registration to include the new rule in the linter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@lambda47 lambda47 force-pushed the feature/linter_promise_always-return_rule branch from ddc8c12 to 40a641f Compare August 20, 2025 01:59
@lambda47 lambda47 requested a review from camc314 August 20, 2025 02:04
Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@camc314 camc314 merged commit c6c5075 into oxc-project:main Aug 20, 2025
25 checks passed
This was referenced Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants