2.0.1 β€’ Published 1 year ago

@putout/plugin-remove-useless-for-of v2.0.1

Weekly downloads
2,098
License
MIT
Repository
github
Last release
1 year ago

@putout/plugin-remove-useless-for-of NPM version

The Array enables storing a collection of multiple items under a single variable name.

(c) MDN

🐊Putout plugin adds ability to remove useless for...of statements. Merged to @putout/plugin-for-of.

Install

npm i @putout/plugin-remove-useless-for-of

Rule

{
    "rules": {
        "remove-useless-for-of": "on"
    }
}

❌ Example of incorrect code

for (const a of ['hello']) {
    console.log(a);
}

βœ… Example of correct code

console.log('hello');

License

MIT