You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Description
NewExpression and CallExpression are basically identical in terms of arguments list. Among others, you're perfectly fine with spreading arguments in both of them:
Ofc happy to preapre a PR for this, but as this is my first contribution to typescript-eslint, I wanted to make sure this is discussed and that my thinking is correct
burtek
changed the title
Enhancement: Allow NewExpression arguments to be a SpreadElement.
Bug: NewExpression doesn't allow SpreadElement as argument
Aug 4, 2022
Before You File a Proposal Please Confirm You Have Done The Following...
Relevant Package
ast-spec
My proposal is suitable for this project
Description
NewExpression
andCallExpression
are basically identical in terms of arguments list. Among others, you're perfectly fine with spreading arguments in both of them:That is reflected in
CallExpression
type:typescript-eslint/packages/ast-spec/src/expression/CallExpression/spec.ts
Lines 7 to 10 in d2394f8
With
CallExpressionArgument
being:typescript-eslint/packages/ast-spec/src/unions/CallExpressionArgument.ts
Line 4 in d2394f8
At the same time,
NewExpression
typing allows onlyExpression
arguments:typescript-eslint/packages/ast-spec/src/expression/NewExpression/spec.ts
Lines 7 to 10 in d2394f8
SpreadElement
is not there, even though it is legal to spread arguments in constructor call (playground)Fail
Pass
Additional Info
No response
The text was updated successfully, but these errors were encountered: