@putout/plugin-split-variable-declarations

3.0.0 • Public • Published

@putout/plugin-split-variable-declarations NPM version

  • The let statement declares a block-scoped local variable, optionally initializing it to a value.
  • const statements are also block-scoped. The value of a constant can't be changed through reassignment, and it can't be redeclared. However, if a constant is an object or array its properties or items can be updated or removed.

(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.

Install

npm i @putout/plugin-split-variable-declarations

Rule

{
    "rules": {
        "split-variable-declarations": "on"
    }
}

Example of incorrect code

let a, b;

Example of correct code

let a;
let b;

License

MIT

Package Sidebar

Install

npm i @putout/plugin-split-variable-declarations

Weekly Downloads

6,166

Version

3.0.0

License

MIT

Unpacked Size

5.17 kB

Total Files

4

Last publish

Collaborators

  • coderaiser