@putout/plugin-convert-throw
putout plugin adds ability to convert throw statement into throw expression
Last updated 6 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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

  • 2.0.0                                ...           latest (2 months ago)

3 Versions

  • 2.0.0                                ...           2 months ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |