Skip to content

fix(promise-function-async): place async fix after export modifiers#839

Merged
graphite-app[bot] merged 1 commit into
mainfrom
c/03-27-fix_promise-function-async_place_async_fix_after_export_modifiers
Mar 27, 2026
Merged

fix(promise-function-async): place async fix after export modifiers#839
graphite-app[bot] merged 1 commit into
mainfrom
c/03-27-fix_promise-function-async_place_async_fix_after_export_modifiers

Conversation

@camc314

@camc314 camc314 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

@camc314 camc314 marked this pull request as ready for review March 27, 2026 11:11
Copilot AI review requested due to automatic review settings March 27, 2026 11:11

camc314 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

How to use the Graphite Merge Queue

Add 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.

Copilot AI left a comment

Copy link
Copy Markdown

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 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 async after the last modifier for FunctionDeclaration nodes (while keeping existing behavior for methods/other function-like nodes).
  • Added new invalid test cases covering export function ... and export 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.

camc314 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

@graphite-app graphite-app Bot force-pushed the c/03-27-fix_promise-function-async_place_async_fix_after_export_modifiers branch from 9553d81 to 0a667a0 Compare March 27, 2026 11:27
@graphite-app graphite-app Bot merged commit 0a667a0 into main Mar 27, 2026
8 checks passed
@graphite-app graphite-app Bot deleted the c/03-27-fix_promise-function-async_place_async_fix_after_export_modifiers branch March 27, 2026 11:34
@graphite-app graphite-app Bot removed the 0-merge label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: typescript/promise-function-async - wrong fix with exported functions

2 participants