@putout/plugin-convert-assignment-to-declaration

1.0.1 • Public • Published

@putout/plugin-convert-assignment-to-declaration NPM version

The assignment (=) operator is used to assign a value to a variable or property.

(c) MDN

The const declaration declares block-scoped local variables. The value of a constant can't be changed through reassignment using the assignment operator, but if a constant is an object, its properties can be added, updated, or removed.

(c) MDN

🐊Putout plugin adds ability to convert assignment to declaration. Checkout in 🐊Putout Editor.

Install

npm i @putout/plugin-convert-assignment-to-declaration -D

Rule

{
    "rules": {
        "convert-assignment-to-declaration": "on"
    }
}

❌ Example of incorrect code

a = 5;

✅ Example of correct code

const a = 5;

License

MIT

Package Sidebar

Install

npm i @putout/plugin-convert-assignment-to-declaration

Weekly Downloads

3,454

Version

1.0.1

License

MIT

Unpacked Size

4.78 kB

Total Files

4

Last publish

Collaborators

  • coderaiser