@putout/plugin-merge-return-with-next-sibling
🐊Putout plugin adds ability to merge return with next sibling
Last updated a year ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (a year ago)

2 Versions

  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |