1.4.1 β’ Published 1 year ago
@putout/plugin-apply-comparison-order v1.4.1
@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