@putout/plugin-apply-comparison-order

1.4.1 • Public • Published

@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

Linter Rule Fix
🐊 Putout apply-comparison-order
ESLint yoda ½

License

MIT

Package Sidebar

Install

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

Weekly Downloads

1,087

Version

1.4.1

License

MIT

Unpacked Size

5.58 kB

Total Files

4

Last publish

Collaborators

  • coderaiser