Skip to content

Commit 2d9e80a

Browse files
committed
remove early returns for async function in component detection
1 parent dca6503 commit 2d9e80a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/util/Components.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ function componentRule(rule, context) {
855855
},
856856

857857
FunctionExpression(node) {
858-
if (node.async) {
858+
if (node.async && node.generator) {
859859
components.add(node, 0);
860860
return;
861861
}
@@ -868,7 +868,7 @@ function componentRule(rule, context) {
868868
},
869869

870870
FunctionDeclaration(node) {
871-
if (node.async) {
871+
if (node.async && node.generator) {
872872
components.add(node, 0);
873873
return;
874874
}
@@ -881,11 +881,6 @@ function componentRule(rule, context) {
881881
},
882882

883883
ArrowFunctionExpression(node) {
884-
if (node.async) {
885-
components.add(node, 0);
886-
return;
887-
}
888-
889884
const component = utils.getStatelessComponent(node);
890885
if (!component) {
891886
return;

0 commit comments

Comments
 (0)