npm.io
4.0.2 • Published 3 years ago

@putout/plugin-remove-constant-conditions

Licence
MIT
Version
4.0.2
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
797

@putout/plugin-remove-constant-conditions NPM version

Putout plugin adds ability to find and remove constant conditions. Merged to @putout/plugin-conditions.

Install

npm i @putout/plugin-remove-constant-conditions -D

Rule

{
    "rules": {
        "remove-constant-conditions": "on"
    }
}

Example of incorrect code

function hi(a) {
    if (2 < 3) {
        console.log('hello');
        console.log('world');
    }
}

Example of correct code

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

License

MIT

Keywords