prefer-array-search Prefer direct Array search operations Indirect searches allocate arrays, discard indices, or invoke callbacks for builtin equality. Instead, you SHOULD use the direct Array search matching that result. find and findLast return an element. some and includes return membership. indexOf and lastIndexOf return a position. Reverse searches can change predicate or comparison order and require review. - Category: performance - Level: warning - Fix: suggestion - Scope: module Reported function firstPositive(values: int32[]): int32 | undefined { return values.filter((value) => value > 0).at(0); } Accepted function firstPositive(values: int32[]): int32 | undefined { return values.find((value) => value > 0); } Prior art - typescript-eslint · prefer-find - typescript-eslint · prefer-includes - eslint-plugin-unicorn · prefer-array-index-of - eslint-plugin-unicorn · prefer-array-some language/linter/src/rules/performance/preferarraysearch.rs:8