1.4.1 β€’ Published 1 year ago

@putout/plugin-apply-comparison-order v1.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@putout/plugin-apply-comparison-order NPM version

The result of evaluating an equality operator is always of type boolean based on whether the comparison is true.

(c) MDN

🐊Putout plugin adds ability to apply comparison order. Checkout it 🐊Putout Editor. Merged to @putout/plugin-conditions.

Install

npm i @putout/plugin-apply-comparison-order

Rule

{
    "rules": {
        "apply-comparison-order": "on"
    }
}

❌ Example of incorrect code

3 === a;
3 < b;

βœ… Example of correct code

a === 3;
b > 3;

Comparison

LinterRuleFix
🐊 Putoutapply-comparison-orderβœ…
⏣ ESLintyoda½

License

MIT