When comparing the index of an item with an findIndex
method, it can be more expressive to use R.some
, when only the sole existence of a matching item is taken into account.
The following patterns are considered warnings:
var a = R.findIndex(b, f) === -1;
var a = R.findIndex(b, f) >= 0;
The following patterns are not considered warnings:
x = R.findIndex(a, f);
R.findIndex(a, f) === 2;
if (R.some(a, f)) {
// ...
}
If you do not want to enforce using R.findIndex
, you should not use this rule.