JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20800
  • Score
    100M100P100Q164180F
  • License MIT

🐊Putout plugin adds ability to find and remove process.exit

Package Exports

  • @putout/plugin-split-variable-declarations
  • @putout/plugin-split-variable-declarations/lib/split-variable-declarations.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@putout/plugin-split-variable-declarations) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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;

Comparison

Linter Rule Fix
🐊 Putout remove-debugger βœ…
⏣ ESLint no-var βœ…

License

MIT