| 1 | # es/no-for-of-loops |
| 2 | > disallow `for-of` statements |
| 3 | |
| 4 | - ✅ The following configurations enable this rule: `plugin:es/no-new-in-es2015`, `plugin:es/restrict-to-es3`, and `plugin:es/restrict-to-es5` |
| 5 | |
| 6 | This rule reports ES2015 `for-of` statements as errors. |
| 7 | |
| 8 | ## Examples |
| 9 | |
| 10 | ⛔ Examples of **incorrect** code for this rule: |
| 11 | |
| 12 | <eslint-playground type="bad" code="/*eslint es/no-for-of-loops: error */ |
| 13 | for (var a of b) {} |
| 14 | for (let a of b) {} |
| 15 | for (a of b) {} |
| 16 | " /> |
| 17 | |
| 18 | ## 📚 References |
| 19 | |
| 20 | - [Rule source](https://github.com/mysticatea/eslint-plugin-es/blob/v4.1.0/lib/rules/no-for-of-loops.js) |
| 21 | - [Test source](https://github.com/mysticatea/eslint-plugin-es/blob/v4.1.0/tests/lib/rules/no-for-of-loops.js) |