Skip to content

Commit

Permalink
fix(eslint-plugin): explicit-module-boundary-types
Browse files Browse the repository at this point in the history
Exit early when the type of the ancestor of the node being checked is
not a return statement.
  • Loading branch information
ifiokjr committed May 26, 2020
1 parent 89a4f07 commit ce93945
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
Expand Up @@ -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;

Expand Down

0 comments on commit ce93945

Please sign in to comment.