@putout/plugin-remove-useless-else
🐊Putout plugin adds ability use apply early return
Last updated 2 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-remove-useless-else 
SYNC missed versions from official npm registry.

@putout/plugin-remove-useless-else NPM version

You can skip the else block if your if block always executes a return statement, it makes code a lot easier to read.

(c) no else return

🐊Putout plugin adds ability to remove useless else. Merged to @putout/plugin-conditions.

Install

npm i @putout/plugin-remove-useless-else

Rule

{
    "rules": {
        "remove-useless-else": "on"
    }
}

❌ Example of incorrect code

if (x)
    return;
else
    console.log();

✅ Example of correct code

if (x)
    return;

console.log();

License

MIT

Current Tags

  • 2.0.2                                ...           latest (a year ago)

6 Versions

  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           2 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 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 (8)
Dependents (1)

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