@putout/plugin-merge-return-with-next-sibling 
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 merge return
with next sibling. Checkout in 🐊Putout Editor.
Install
npm i @putout/plugin-merge-return-with-next-sibling
Rule
{
"rules": {
"merge-return-with-next-sibling": "on"
}
}
❌ Example of incorrect code
function x() {
return
{
hello: 'world';
}
return
5;
return
a ? 2 : 3;
}
✅ Example of correct code
function x() {
return {
hello: 'world',
};
return 5;
return a ? 2 : 3;
}
License
MIT