Skip to content

Commit

Permalink
fix: special handling of identifiers no longer required
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed May 9, 2024
1 parent e91c051 commit adbe742
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,9 @@ export function getTypeImmutabilityOfNode<
const overrides =
explicitOverrides ?? getImmutabilityOverrides(context.settings);
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
const typedNode = ts.isIdentifier(tsNode) ? tsNode.parent : tsNode;
const typeLike =
(typedNode as { type?: TypeNode }).type ??
getTypeOfNode(parserServices.tsNodeToESTreeNodeMap.get(typedNode), context);
(tsNode as { type?: TypeNode }).type ??
getTypeOfNode(parserServices.tsNodeToESTreeNodeMap.get(tsNode), context);

return getTypeImmutability(
parserServices.program,
Expand Down

0 comments on commit adbe742

Please sign in to comment.