1.2.0 • Published 3 years ago

@putout/plugin-remove-unreachable-code v1.2.0

Weekly downloads
2,938
License
MIT
Repository
github
Last release
3 years ago

@putout/plugin-remove-unreachable-code NPM version Dependency Status

putout plugin adds ability to find and remove unreachable code.

Install

npm i @putout/plugin-remove-unreachable-code

Rule

{
    "rules": {
        "remove-unreachable-code": "on"
    }
}

❌ Incorrect code example

function hi() {
    return 'world';
    console.log('hello');
}

function log() {
    throw Error('error');
    console.log('hello');
}

✅ Correct code Example

function hi() {
    return 'world';
}

function log() {
    throw Error('error');
}

License

MIT