Skip to content

Fix noopAsync to return Promise<void> instead of Promise<number>#44

Closed
kamarmack with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-43
Closed

Fix noopAsync to return Promise<void> instead of Promise<number>#44
kamarmack with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-43

Conversation

Copilot AI commented Jul 26, 2025

Copy link
Copy Markdown
Contributor

The noopAsync function was incorrectly returning Promise<number> by using Promise.resolve(0), but as a no-op function it should return Promise<void> since it doesn't produce any meaningful value.

Changes Made

  • Updated utils/noop.ts to change Promise.resolve(0) to Promise.resolve()
  • Added explicit Promise<void> return type annotation for clarity
  • The function now correctly returns Promise<void> as expected for an async no-op function

Before

export function noopAsync() {
    return Promise.resolve(0);
}

After

export function noopAsync(): Promise<void> {
    return Promise.resolve();
}

This change ensures type consistency and follows the expected behavior where no-op functions should not return meaningful values.

Fixes #43.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@kamarmack kamarmack marked this pull request as ready for review July 26, 2025 23:12
@kamarmack kamarmack closed this Jul 26, 2025
@kamarmack kamarmack deleted the copilot/fix-43 branch July 26, 2025 23:13
Copilot AI restored the copilot/fix-43 branch July 26, 2025 23:15
Copilot AI changed the title [WIP] Make the async no-op fn return Promise<void> not Promise<numberz> Fix noopAsync to return Promise<void> instead of Promise<number> Jul 26, 2025
Copilot AI requested a review from kamarmack July 26, 2025 23:18
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.

Make the async no-op fn return Promise<void> not Promise<number>

2 participants