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
This commit is contained in:
Dan Abramov authored and GitHub committed 2018-02-09 16:11:22 +00:00
1 parent b5e9615087
commit 467b1034ce
13 files changed
+30 -5

No files matched your search

+1
View File
@@ -20,6 +20,7 @@ function invertObject(targetObj /* : ErrorMap */) /* : ErrorMap */ {
const result = {};
const mapKeys = Object.keys(targetObj);
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
for (const originalKey of mapKeys) {
const originalVal = targetObj[originalKey];