When using R.filter and accessing the first or last result, you should probably use R.find
or R.findLast
, respectively.
This rule takes no arguments.
The following patterns are considered warnings:
const x = R.filter(a, f)[0];
const x = R.head(R.filter(a, f));
const x = R.last(R.filter(a, f));
const x = R.head(R.reject(a, f));
The following patterns are not considered warnings:
const x = R.filter(a, f);
const x = R.filter(a, f)[3];
const x = R.find(a, f);