7.0.2 β’ Published 9 months ago
@putout/plugin-remove-useless-return v7.0.2
@putout/plugin-remove-useless-return 
The
returnstatement 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. Merged with @putout/plugin-return.
Install
npm i @putout/plugin-remove-useless-returnRule
{
"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