From 4001424a173d496820f204e6c9a66197773f95e0 Mon Sep 17 00:00:00 2001 From: Michal Zgliczynski Date: Wed, 20 Mar 2024 14:49:37 +0100 Subject: [PATCH] Add back recursive logic --- packages/jsts/src/rules/helpers/ast.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/jsts/src/rules/helpers/ast.ts b/packages/jsts/src/rules/helpers/ast.ts index 73bb5665d46..80f5bd52f79 100644 --- a/packages/jsts/src/rules/helpers/ast.ts +++ b/packages/jsts/src/rules/helpers/ast.ts @@ -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);