Skip to content

Latest commit

 

History

History

plugin-simplify-boolean-return

@putout/plugin-simplify-boolean-return NPM version

🐊Putout plugin adds ability to simplify boolean return.

Install

npm i @putout/plugin-simplify-boolean-return -D

Rule

{
    "rules": {
        "simplify-boolean-return": "on"
    }
}

Check out in 🐊Putout Editor.

❌ Example of incorrect code

function isA(a, b) {
    if (a.length === b.length)
        return true;
    
    return false;
}

✅ Example of correct code

function isA(a, b) {
    return a.length !== b.length;
}

License

MIT