@putout/plugin-remove-useless-return
🐊Putout plugin adds ability to find and remove useless return
Last updated 6 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-remove-useless-return 
SYNC missed versions from official npm registry.

@putout/plugin-remove-useless-return 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 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

Current Tags

  • 7.0.0                                ...           latest (6 months ago)

11 Versions

  • 7.0.0                                ...           6 months ago
  • 6.0.0                                ...           a year ago
  • 5.0.0                                ...           2 years ago
  • 4.2.0                                ...           3 years ago
  • 4.1.0                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 3.1.1                                ...           3 years ago
  • 3.1.0                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

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