@putout/plugin-merge-if-statements

3.1.1 • Public • Published

@putout/plugin-merge-if-statements NPM version

The if statement executes a statement if 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

Package Sidebar

Install

npm i @putout/plugin-merge-if-statements

Weekly Downloads

16,903

Version

3.1.1

License

MIT

Unpacked Size

4.82 kB

Total Files

4

Last publish

Collaborators

  • coderaiser