@putout/plugin-remove-double-negations

4.0.1 • Public • Published

@putout/plugin-remove-double-negations NPM version

To explicitly convert its return value (or any expression in general) to the corresponding boolean value can be used a double NOT operator (!!).

(c) MDN

🐊Putout plugin adds ability to remove double negations from conditionals. Merged to remove-unused-type-convertion

Install

npm i @putout/plugin-remove-double-negations

Rule

{
    "rules": {
        "remove-double-negations": "off"
    }
}

Example of incorrect code

if (!!a) {
    console.log('hi');
}

Example of correct code

if (a) {
    console.log('hi');
}

License

MIT

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i @putout/plugin-remove-double-negations

    Weekly Downloads

    8,204

    Version

    4.0.1

    License

    MIT

    Unpacked Size

    3.97 kB

    Total Files

    4

    Last publish

    Collaborators

    • coderaiser