Skip to content

Conversation

@connorshea
Copy link
Collaborator

@connorshea connorshea commented Oct 31, 2025

Part of #14743.

Generated docs:

## Configuration

This rule accepts a configuration object with the following properties:

### callbacks

type: `string[]`

default: `["callback", "cb", "done", "next"]`

List of callback function names to check for within Promise `then` and `catch` methods.


### exceptions

type: `string[]`

default: `[]`

List of callback function names to allow within Promise `then` and `catch` methods.

Copilot AI review requested due to automatic review settings October 31, 2025 03:35
@connorshea connorshea requested a review from camc314 as a code owner October 31, 2025 03:35
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 31, 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-docs Category - Documentation. Related to user-facing or internal documentation labels Oct 31, 2025
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 refactors the no_callback_in_promise rule to rename the callbacks configuration field to exceptions and adds schema support for better configuration handling.

  • Renamed the configuration field from callbacks to exceptions with clearer documentation
  • Added JsonSchema derive and serde attributes for proper schema generation
  • Updated all references to use the new exceptions field name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@connorshea connorshea marked this pull request as draft October 31, 2025 03:39
@connorshea
Copy link
Collaborator Author

connorshea commented Oct 31, 2025

Actually I think Copilot is right and I misunderstood the intent of the callbacks config field here, it's distinct from exceptions (which was not previously represented in the config struct, and callbacks never existed in the original ESLint rule, which is the source of my assumption/confusion).

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 31, 2025

CodSpeed Performance Report

Merging #15176 will not alter performance

Comparing connorshea:no-callback-in-promise-docs (a0ecc57) with main (1b9f6fc)1

Summary

✅ 4 untouched
⏩ 33 skipped2

Footnotes

  1. No successful run was found on main (baaeca8) during the generation of this report, so 1b9f6fc was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 33 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.

…n-promise rule.

Also rename the struct field name from `callbacks` to `exceptions`, as that's what is actually used in the code and is what's defined in the original ESLint rule.
And define "exceptions" explicitly in the struct.
@connorshea connorshea force-pushed the no-callback-in-promise-docs branch from 074dd3f to 76039c5 Compare October 31, 2025 17:59
@connorshea connorshea marked this pull request as ready for review October 31, 2025 19:55
@camc314 camc314 merged commit 3f393e3 into oxc-project:main Nov 2, 2025
22 checks passed
@Boshen Boshen mentioned this pull request Nov 5, 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-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants