Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

@putout/plugin-remove-empty

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/plugin-remove-empty

putout plugin adds ability to find and remove blocks with empty body

Source
npmnpm
Version
2.2.0
Version published
Maintainers
1
Created
Source

putout-plugin-remove-empty NPM version Dependency Status

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);
// outputs
`
if (2 > 3) {
}
`

const result = putout(source, {
    plugins: [
        'remove-empty'
    ]
});
// returns
''

License

MIT

Keywords

putout

FAQs

Package last updated on 28 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts