putout-plugin-remove-empty
putout
plugin adds ability to find and remove:
empty block statements
;empty patterns
;empty imports
;
Install
npm i @putout/plugin-remove-empty
Rule
Rules remove-empty
is enabled by default, to disable add to .putout.json
:
{
"rules": {
"remove-empty/block": false,
"remove-empty/pattern": false,
"remove-empty/import": false
}
}
Code Example
const {readFileSync} = require('fs');
const source = readFileSync('./1.js', 'utf8');
const putout = require('putout');
console.log(source);
`
if (2 > 3) {
}
`
const result = putout(source, {
plugins: [
'remove-empty'
]
});
''
License
MIT