Skip to content

Commit

Permalink
oops this doesn't work in 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlyu123 committed Mar 16, 2024
1 parent 4076d61 commit 35510ed
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,13 +545,14 @@ function expectedTransitionThirdArgument(

// in TypeScript 5.4 the error is on the function name
// in earlier versions it's on the whole call expression
const callExpression = ts.isCallExpression(node.parent)
? node.parent
: findNodeAtSpan(
node,
{ start: node.getStart(), length: node.getWidth() },
ts.isCallExpression
);
const callExpression =
ts.isIdentifier(node) && ts.isCallExpression(node.parent)
? node.parent
: findNodeAtSpan(
node,
{ start: node.getStart(), length: node.getWidth() },
ts.isCallExpression
);

const signature =
callExpression && lang.getProgram()?.getTypeChecker().getResolvedSignature(callExpression);
Expand Down

0 comments on commit 35510ed

Please sign in to comment.