@putout/plugin-convert-throw
🐊Putout plugin adds ability to convert throw statement into throw expression
Last updated 5 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-convert-throw 
SYNC missed versions from official npm registry.

@putout/plugin-convert-throw NPM version

This proposal defines new syntax to throw exceptions from within an expression context.

(c) tc39

🐊Putout plugin adds ability convert throw statement to expression.

Install

npm i @putout/plugin-convert-throw -D

Rule

{
    "rules": {
        "convert-throw": "on"
    },
    "plugins": [
        "convert-throw"
    ]
}

❌ Example of incorrect code

const fn = () => {
    throw Error('hello');
};

✅ Example of correct code

const fn = () => throwError('hello');

License

MIT

Current Tags

  • 3.0.0                                ...           latest (5 months ago)

4 Versions

  • 3.0.0                                ...           5 months ago
  • 2.0.0                                ...           10 months ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (9)
Dependents (1)

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