@putout/plugin-convert-comparison-to-boolean

3.0.3 • Public • Published

@putout/plugin-convert-comparison-to-boolean NPM version

Strict equality compares two values for equality. Neither value is implicitly converted to some other value before being compared. If the values have different types, the values are considered unequal.

(c) MDN

🐊Putout plugin adds ability to find and convert binary expression to boolean. Merged to @putout/plugin-conditions.

Install

npm i @putout/plugin-convert-comparison-to-boolean -D

Rule

{
    "rules": {
        "convert-comparison-to-boolean": "on"
    }
}

Example of incorrect code

const t = 2 < 3;

Example of correct code

const t = false;

License

MIT

Package Sidebar

Install

npm i @putout/plugin-convert-comparison-to-boolean

Weekly Downloads

12,632

Version

3.0.3

License

MIT

Unpacked Size

4.9 kB

Total Files

4

Last publish

Collaborators

  • coderaiser