fix(promise-function-async): place async fix after export modifiers#839
Conversation
How to use the Graphite Merge QueueAdd the label 0-merge to this PR to add it to the merge queue. 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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR fixes the auto-fix placement for the promise-function-async rule so that inserting async into exported function declarations results in valid modifier ordering (e.g., export async function instead of async export function), addressing oxc-project/oxc#20783.
Changes:
- Adjusted the rule fixer to insert
asyncafter the last modifier forFunctionDeclarationnodes (while keeping existing behavior for methods/other function-like nodes). - Added new invalid test cases covering
export function ...andexport default function ...fix output placement. - Updated the rule snapshot to reflect the newly added test cases and renumbered invalid cases.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/rules/promise_function_async/promise_function_async.go | Updates fixer logic to insert async after export/default modifiers for function declarations. |
| internal/rules/promise_function_async/promise_function_async_test.go | Adds regression tests ensuring async is placed after export / export default. |
| internal/rule_tester/snapshots/promise-function-async.snap | Updates snapshot output for new/renumbered invalid test cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
9553d81 to
0a667a0
Compare

fixes oxc-project/oxc#20783