@putout/plugin-simplify-ternary

    2.6.0 • Public • Published

    @putout/plugin-simplify-ternary NPM version Dependency Status

    putout plugin adds ability to simplify ternary.

    Install

    npm i @putout/plugin-simplify-ternary -D
    

    Rule

    {
        "rules": {
            "simplify-ternary": "on"
        }
    }

    Incorrect code example

    module.exports = fs.copyFileSync ? fs.copyFileSync : copyFileSync;
    
    x = y ? y : z;
    x = y ? z : y;

    Correct code Example

    module.exports = fs.copyFileSync || copyFileSync;
    
    x = y || z;
    x = y && z;

    License

    MIT

    Install

    npm i @putout/plugin-simplify-ternary

    DownloadsWeekly Downloads

    3,636

    Version

    2.6.0

    License

    MIT

    Unpacked Size

    3.71 kB

    Total Files

    4

    Last publish

    Collaborators

    • coderaiser