Skip to content

Commit

Permalink
Add back recursive logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zglicz committed Mar 20, 2024
1 parent 6542c7d commit 4001424
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/jsts/src/rules/helpers/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,11 @@ function getPropertyFromSpreadElement(
ctx: Rule.RuleContext,
): estree.Property | null | undefined {
const props = getValueOfExpression(ctx, spreadElement.argument, 'ObjectExpression');
if (props === undefined) {
const recursiveDefinition = findFirstMatchingAncestor(
spreadElement.argument as TSESTree.Node,
node => node === props,
);
if (recursiveDefinition || props === undefined) {
return undefined;
}
return getProperty(props, key, ctx);
Expand Down

0 comments on commit 4001424

Please sign in to comment.