1.2.0 β€’ Published 12 months ago

@putout/plugin-split-assignment-expressions v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@putout/plugin-split-assignment-expressions NPM version

The assignment (=) operator is used to assign a value to a variable or property. The assignment expression itself has a value, which is the assigned value. This allows multiple assignments to be chained in order to assign a single value to multiple variables.

(c) MDN

🐊Putout plugin adds ability to find and split variable declarations because (re)moving a line is simpler and less error prone then changing coma (=) to colon (;).

For the same reason, diff of changed declarations are more comfortable to read. Checkout in 🐊Putout Editor.

Install

npm i @putout/plugin-split-assignment-expressions

Rule

{
    "rules": {
        "split-assignment-expressions": "on"
    }
}

❌ Example of incorrect code

a = b = c = 1;

βœ… Example of correct code

a = 1;
b = a;
c = a;

License

MIT

1.2.0

12 months ago

1.1.0

12 months ago

1.0.0

1 year ago