$ npm install @putout/plugin-remove-useless-variables
πPutout plugin adds ability to find and remove useless variables
.
npm i @putout/plugin-remove-useless-variables -D
{
"rules": {
"remove-useless-variables/rename": "on",
"remove-useless-variables/remove": "on",
"remove-useless-variables/destruct": "on",
"remove-useless-variables/await": "on",
"remove-useless-variables/declaration": "on",
"remove-useless-variables/duplicate": "on"
}
}
function hi(a) {
const b = a;
}
function hi(b) {}
function hi(c) {
const {a, b} = c;
}
function hi({a, b}) {}
const child_process = require('node:child_process');
const {exec, spawn} = child_process;
const {exec, spawn} = require('node:child_process');
Check it out in πPutout Editor.
const a = 5;
const b = a;
const c = 5;
d = c;
const b = 5;
d = 5;
Check it out in πPutout Editor.
function x() {
const a = 5;
return a;
}
function x() {
return 5;
}
Check it out in πPutout Editor.
const DestructuringErrors = function DestructuringErrors(a, b) {
return [a, b];
};
function DestructuringErrors(a, b) {
return [a, b];
}
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE