Split Multi-Variable Declarations

Convert variable declarations with multiple variables into separate declarations that declare one variable each.

For example,

let a = 2, b;

is converted into

let a = 2;
let b;

Original Code

Changes

1const world = 'world', // a comment1const world = 'world'; // a comment
2 p = 42; // another comment2const p = 42; // another comment
3 3
4console.log(`Hello, ${world}!`);4console.log(`Hello, ${world}!`);
1const world = 'world', // a comment
2 p = 42; // another comment
1const world = 'world'; // a comment
2const p = 42; // another comment
33
44console.log(`Hello, ${world}!`);

Transformed Code

const world = 'world'; // a comment
const p = 42; // another comment

console.log(`Hello, ${world}!`);

Explore More