@putout/plugin-remove-empty

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

Usage no npm install needed!

<script type="module">
  import putoutPluginRemoveEmpty from 'https://cdn.skypack.dev/@putout/plugin-remove-empty';
</script>

README

@putout/plugin-remove-empty NPM version

🐊Putout plugin adds ability to find and remove:

  • empty block statements;
  • empty patterns;
  • empty imports;
  • empty arguments;
  • empty exports;

Install

npm i @putout/plugin-remove-empty

Rules

{
    "rules": {
        "remove-empty/block": "on",
        "remove-empty/pattern": "on",
        "remove-empty/argument": "on",
        "remove-empty/export": "on",
        "remove-empty/import": ["on", {
            "ignore": []
        }]
    }
}

block

-if (2 > 3) {}

pattern

-const [] = array;
-const {} = object;

export

-export {};

import

-import 'abc';

arguments

❌ Incorrect code example

module.exports = ({rule, plugin, msg, options}, {}) => {
};

✅ Correct code Example

module.exports = ({rule, plugin, msg, options}) => {
};

License

MIT