Skip to content

async function needs Promise<T> return type quick fix #36266

Closed
@JacksonKearl

Description

@JacksonKearl

Search Terms

  • return type quick fix
  • async function quick fix
  • global promise type

Suggestion

It would be nice if TypeScript contributed a quick fix to resolve The return type of an async or global function must be the global Promise<T> type errors. The fix would simply wrap the existing return type into a Promise.

Checklist

My suggestion meets these guidelines:

  • [x ] This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • [ x] This wouldn't change the runtime behavior of existing JavaScript code
  • [ x] This could be implemented without emitting different JS based on the types of the expressions
  • [x ] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • [x ] This feature would agree with the rest of TypeScript's Design Goals.

Metadata

Metadata

Assignees

Labels

Domain: Error MessagesThe issue relates to error messagingDomain: Quick FixesEditor-provided fixes, often called code actions.Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Experience EnhancementNoncontroversial enhancementsHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions