@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-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 |
---|---|---|
apply-comparison-order |
||
⏣ ESLint | yoda |
½ |
License
MIT