Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@putout/plugin-convert-for-to-for-of

coderaiser29.2kMIT4.0.2

🐊Putout plugin adds ability to convert for to for-of

putout, putout-plugin, putout-plugin-convert, plugin, convert, for, for-of

readme

@putout/plugin-convert-for-to-for-of NPM version

The for statement creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement to be executed in the loop.

The for...of statement creates a loop which invokes a custom iteration hook with statements to be executed for the value of each element of an array.

(c) MDN

🐊Putout plugin adds ability to convert for to for...of loop. Merged to @putout/plugin-for-of.

Install

npm i @putout/plugin-convert-for-to-for-of -D

Rule

{
    "rules": {
        "convert-for-to-for-of/n": "on",
        "convert-for-to-for-of/length": "on",
        "convert-for-to-for-of/entries": "on"
    }
}

License

MIT