Skip to content

Commit

Permalink
Add ts.isPropertyAssignment to isConsiderReferencedNS
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 5, 2024
1 parent 700a091 commit e4bada4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/knip/src/typescript/ast-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const getDestructuredIds = (name: ts.ObjectBindingPattern) =>
name.elements.map(element => element.name.getText());

export const isConsiderReferencedNS = (node: ts.Identifier) =>
ts.isPropertyAssignment(node.parent) ||
ts.isShorthandPropertyAssignment(node.parent) ||
(ts.isCallExpression(node.parent) && node.parent.arguments.includes(node)) ||
ts.isSpreadAssignment(node.parent) ||
Expand Down

0 comments on commit e4bada4

Please sign in to comment.