⚡️ Performance: [no-misused-promises] computes void-returning parameters for calls with no arguments

Author: JoshuaKGoldbergCreated Sep 25, 2026Updated Sep 30, 2026
Labelspackage: eslint-pluginperformanceaccepting prsspam:exempt

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

eslint-plugin

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

no-misused-promises runs checkArguments on every CallExpression and NewExpression. It computes voidFunctionArguments first, which asks the checker for the callee's type, its signatures, and each parameter's type, and only then loops over node.arguments to report promise-returning ones.

A call with no arguments can never report, but it still runs all of those type queries. Returning early when node.arguments.length === 0 would skip them without changing the rule's behavior.

Suggestion: shall we do this little optimization? I sent #12923 as a draft for reference.

Additional Info

Found while profiling the experimental TypeScript 7 native backend in #12803, where each type query is a round trip to another process. On a 1024-file project with recommendedTypeChecked, it removes ~1,000 of ~6,200 remaining round trips and ~59 ms of rule time.

With classic in-process TypeScript on the same project, the rule's own time drops from ~21 ms to ~8 ms.

Source: typescript-eslint/typescript-eslint