15.0.0 β’ Published 6 months ago
@putout/plugin-remove-empty v15.0.0
@putout/plugin-remove-empty 
πPutout plugin adds ability to find and remove:
empty blocks;empty static blocks;empty patterns;empty arguments;
Install
npm i @putout/plugin-remove-emptyRules
- β block;
- β static-block;
- β pattern;
- β nested-pattern;
- β argument;
Config
{
"rules": {
"remove-empty/block": "on",
"remove-empty/static-block": "on",
"remove-empty/pattern": "on",
"remove-empty/nested-pattern": "on",
"remove-empty/argument": "on"
}
}block
-if (2 > 3) {}static-block
Check it out in πPutout Editor.
class Hello {
- static {
- }
}pattern
-const [] = array;
-const {} = object;nested-pattern
β Example of incorrect code
export const func = (param) => {
const {
a: {
},
c,
} = param;
return c;
};β Example of correct code
export const func = (param) => {
const {c} = param;
return c;
};arguments
Checkout in πPutout Editor.
β Example of incorrect code
const create = ({} = {}) => 'hello';
module.exports = ({rule, plugin, msg, options}, {}) => {};
const a = {
EmptyStatement({}) {},
};β Example of correct code
const create = () => 'hello';
module.exports = ({rule, plugin, msg, options}) => {};
const a = {
EmptyStatement() {},
};License
MIT
15.0.0
6 months ago
14.0.0
10 months ago
13.0.0
11 months ago
13.0.1
11 months ago
12.0.0
2 years ago
12.1.0
2 years ago
11.0.0
2 years ago
10.3.0
3 years ago
10.4.0
2 years ago
10.0.0
3 years ago
10.1.0
3 years ago
10.2.0
3 years ago
9.2.0
3 years ago
9.1.0
3 years ago
9.0.0
3 years ago
8.1.0
3 years ago
8.2.0
3 years ago
8.0.0
4 years ago
6.1.0
4 years ago
7.0.0
4 years ago
7.1.0
4 years ago
6.0.0
4 years ago
5.5.0
4 years ago
5.4.1
4 years ago
5.4.0
5 years ago
5.3.0
5 years ago
5.2.0
5 years ago
5.1.0
6 years ago
5.0.0
6 years ago
4.0.1
6 years ago
4.0.0
6 years ago
3.1.1
6 years ago
3.1.0
6 years ago
3.0.0
6 years ago
2.9.0
6 years ago
2.8.0
6 years ago
2.7.0
6 years ago
2.6.1
6 years ago
2.6.0
6 years ago
2.5.1
6 years ago
2.5.0
6 years ago
2.4.0
6 years ago
2.3.0
7 years ago
2.2.0
7 years ago
2.1.2
7 years ago
2.1.1
7 years ago
2.1.0
7 years ago
2.0.0
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.0
7 years ago