@putout/plugin-merge-return-with-next-sibling
🐊Putout plugin adds ability to merge return with next sibling
Last updated 2 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-merge-return-with-next-sibling 
SYNC missed versions from official npm registry.

@putout/plugin-merge-return-with-next-sibling NPM version

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. Merged with @putout/plugin-return.

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

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

2 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE