prefer-array-some
should also check for misuse of Array.findIndex()
#1870
Labels
prefer-array-some
should also check for misuse of Array.findIndex()
#1870
Description
prefer-array-some checks for situations in which
Array.filter(...).length > 0
andArray.find(...) != null
could be better written asArray.some(...)
It would be useful to also check for a similar suboptimal pattern:
Array.findIndex(...) > -1
Example:
is equivalent to
Fail
Pass
Additional Info
No response
The text was updated successfully, but these errors were encountered: