@putout/plugin-remove-unreachable-code

1.2.0 • Public • Published

@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

Package Sidebar

Install

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

Weekly Downloads

18,656

Version

1.2.0

License

MIT

Unpacked Size

4.13 kB

Total Files

4

Last publish

Collaborators

  • coderaiser