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);