πPutout plugin adds ability to find and remove blocks with empty body
npm install @putout/plugin-remove-empty[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-empty.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-remove-empty"npm"
πPutout plugin adds ability to find and remove:
- empty blocks;
- empty static blocks;
- empty patterns;
- empty arguments;
```
npm i @putout/plugin-remove-empty
- β
block;
- β
static-block;
- β
pattern;
- β
nested-pattern;
- β
argument;
`json`
{
"rules": {
"remove-empty/block": "on",
"remove-empty/static-block": "on",
"remove-empty/pattern": "on",
"remove-empty/nested-pattern": "on",
"remove-empty/argument": "on"
}
}
`diff`
-if (2 > 3) {}
Check it out in πPutout Editor.
`diff`
class Hello {
- static {
- }
}
`diff`
-const [] = array;
-const {} = object;
`js`
export const func = (param) => {
const {
a: {
},
c,
} = param;
return c;
};
`js`
export const func = (param) => {
const {c} = param;
return c;
};
Checkout in πPutout Editor.
`js
const create = ({} = {}) => 'hello';
module.exports = ({rule, plugin, msg, options}, {}) => {};
const a = {
EmptyStatement({}) {},
};
`
`js
const create = () => 'hello';
module.exports = ({rule, plugin, msg, options}) => {};
const a = {
EmptyStatement() {},
};
``
MIT