putout-plugin-remove-unused-variables
putout
plugin adds ability to find and remove unused variables.
Install
npm i @putout/plugin-remove-unused-variables
Rule
Rule remove-unused-variables
is enabled by default, to disable add to .putout.json
:
{
"rules": {
"remove-unused-variables": false
}
}
Code Example
const {readFileSync} = require('fs');
const source = readFileSync('./1.js', 'utf8');
const putout = require('putout');
console.log(source);
`
const t = 'hello';
const a = t;
`
const result = putout(source, {
plugins: [
'remove-unused-variables'
]
});
`
const t = 'hello';
`
License
MIT