Skip to content

Commit 120b9d1

Browse files
authored
Disable for...of by default, rewrite cases where it matters (#12198)
* Add no-for-of lint rule * Ignore legit use cases of for..of * Rewrite for..of in source code
1 parent 29e99e4 commit 120b9d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ReactTestRenderer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,12 @@ function findAll(
553553
}
554554
}
555555

556-
for (const child of root.children) {
556+
root.children.forEach(child => {
557557
if (typeof child === 'string') {
558-
continue;
558+
return;
559559
}
560560
results.push(...findAll(child, predicate, options));
561-
}
561+
});
562562

563563
return results;
564564
}

0 commit comments

Comments
 (0)