Skip to content

Files

Latest commit

 

History

History
45 lines (32 loc) · 898 Bytes

README.md

File metadata and controls

45 lines (32 loc) · 898 Bytes

@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 = () => throw Error('hello');

License

MIT