@putout/plugin-remove-unreachable-code
🐊Putout plugin adds ability to find and remove unreachable code
Last updated a year ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-remove-unreachable-code 
SYNC missed versions from official npm registry.

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

The JavaScript warning "unreachable code after return statement" occurs when using an expression after a return statement, or when using a semicolon-less return statement but including an expression directly after.

(c) MDN

????Putout plugin adds ability to find and remove unreachable code.

Install

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

Rule

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

❌ Example of incorrect code

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

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

✅ Example of correct code

function hi() {
    return 'world';
}

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

License

MIT

Current Tags

  • 3.0.0                                ...           latest (10 months ago)

8 Versions

  • 3.0.0                                ...           10 months ago
  • 2.2.0                                ...           a year ago
  • 2.1.1                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |