3.1.1 β’ Published 8 months ago
@putout/plugin-merge-if-statements v3.1.1
@putout/plugin-merge-if-statements
The
if
statement executes a statementif
a specified condition is truthy.(c) MDN
πPutout plugin adds ability to merge if
statements. Merged to @putout/plugin-conditions
.
Install
npm i @putout/plugin-merge-if-statements
Rule
{
"rules": {
"merge-if-statements": "on"
}
}
β Example of incorrect code
if (a > b) {
if (b < c) {
console.log('hello');
}
}
β Example of correct code
if (a > b && b < c) {
console.log('hello');
}
License
MIT