🐊Putout plugin adds ability to find and remove:
empty blocks
;empty static blocks
;empty patterns
;empty imports
;empty arguments
;empty exports
;
npm i @putout/plugin-remove-empty
{
"rules": {
"remove-empty/block": "on",
"remove-empty/static-block": "on",
"remove-empty/pattern": "on",
"remove-empty/nested-pattern": "on",
"remove-empty/argument": "on",
"remove-empty/export": "on",
"remove-empty/import": ["on", {
"ignore": []
}]
}
}
-if (2 > 3) {}
Check it out in 🐊Putout Editor.
class Hello {
- static {
- }
}
-const [] = array;
-const {} = object;
export const func = (param) => {
const {
a: {
},
c,
} = param;
return c;
};
export const func = (param) => {
const {c} = param;
return c;
};
-export {};
-import 'abc';
Checkout in 🐊Putout Editor.
const create = ({} = {}) => 'hello';
module.exports = ({rule, plugin, msg, options}, {}) => {};
const a = {
EmptyStatement({}) {},
};
const create = () => 'hello';
module.exports = ({rule, plugin, msg, options}) => {};
const a = {
EmptyStatement() {},
};
MIT