@putout/plugin-apply-comparison-order
v1.4.1
Published
🐊Putout plugin adds ability to apply comparison order
Downloads
2,976
Maintainers
Readme
@putout/plugin-apply-comparison-order
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