mirror of
https://github.com/facebook/react.git
synced 2026-02-23 20:23:02 +00:00
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:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user