diff --git a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts index 2e26f69b1cab..320d4798e8f0 100644 --- a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts +++ b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts @@ -370,6 +370,10 @@ function ancestorHasReturnType( // by an ancestor check. const isParentCheck = true; + if (ancestor?.type !== AST_NODE_TYPES.ReturnStatement) { + return false; + } + // Has a valid type been found in any of the ancestors. let hasType = false;