$ cnpm install @putout/plugin-split-variable-declarations
- The
letstatement declares a block-scoped local variable, optionally initializing it to a value.conststatements 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. Merged with @putout/plugin-variables.
npm i @putout/plugin-split-variable-declarations
{
"rules": {
"split-variable-declarations": "on"
}
}
let a, b;
let a;
let b;
| Linter | Rule | Fix |
|---|---|---|
| ???? Putout | remove-debugger |
✅ |
| ⏣ ESLint | no-var |
✅ |
MIT
Copyright 2013 - present © cnpmjs.org | Home |