@putout/plugin-remove-useless-return
v7.0.0
Published
šPutout plugin adds ability to find and remove useless return
Downloads
33,571
Maintainers
Readme
@putout/plugin-remove-useless-return
The
return
statement ends function execution and specifies a value to be returned to the function caller.(c) MDN
šPutout plugin adds ability to find and remove useless return
.
Install
npm i @putout/plugin-remove-useless-return
Rule
{
"rules": {
"remove-useless-return": "on"
}
}
ā Example of incorrect code
const traverse = ({push}) => {
return {
ObjectExpression(path) {
push(path);
},
};
};
ā Example of correct code
const traverse = ({push}) => ({
ObjectExpression(path) {
push(path);
},
});
License
MIT