@putout/plugin-convert-break-to-return
🐊Putout plugin adds ability to convert 'break' to 'return'
Last updated a year ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-convert-break-to-return 
SYNC missed versions from official npm registry.

@putout/plugin-convert-break-to-return NPM version

The break statement terminates the current loop or switch statement and transfers program control to the statement following the terminated statement.

(c) MDN

SyntaxError: unlabeled break must be inside loop or switch

(c) MDN

????Putout plugin adds ability to convert break to return. Checkout in ????Putout Editor. Merged with @putout/plugin-return.

Install

npm i @putout/plugin-convert-break-to-return -D

Rule

{
    "rules": {
        "convert-break-to-return": "on"
    }
}

❌ Example of incorrect code

function x() {
    if (a)
        break;
    
    return false;
}

✅ Example of correct code

function x() {
    if (a)
        return;
    
    return false;
}

License

MIT

Current Tags

  • 1.0.5                                ...           latest (a year ago)

6 Versions

  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 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 (6)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |