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

Package detail

@putout/plugin-convert-const-to-let

coderaiser24.5kMIT5.0.0

🐊Putout plugin adds ability to convert 'const' to 'let'

putout, putout-plugin, plugin, convert, const, let, var, VariableDeclaration

readme

@putout/plugin-convert-const-to-let NPM version

The TypeError object represents an error when attempting to modify a value that cannot be changed.

(c) MDN

🐊Putout plugin adds ability to convert const to let to avoid TypeError. Check out in 🐊Putout Editor.

Install

npm i @putout/plugin-convert-const-to-let -D

Rule

{
    "rules": {
        "convert-const-to-let": "on"
    }
}

❌ Example of incorrect code

const a = 5;

a = 3;

✅ Example of correct code

let a = 5;

a = 3;

License

MIT