Supporting less-than
as an option for how to style the length check would allow for this rule to be used in conjunction with ones like etc/prefer-less-than
[1] without conflicting. Right now, if the style for checks prefers less than and the zero check is not set to do strict checking, the two errors collide and one has to be ignored over the other.
Less than is purely a style choice, just like greater than or strict equation.
[1] https://github.com/cartant/eslint-plugin-etc/blob/main/docs/rules/prefer-less-than.md
function foo() {
var data = [];
while (data.length > 0) {
console.log('Something for the block');
}
}
function foo() {
var data = [];
while (0 < data.length) {
console.log('Something for the block');
}
}
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too