manual-find Prefer find over a loop returning the first matching element A loop that returns its first match and otherwise returns undefined implements find manually. Instead, you SHOULD return the result of find directly. - Category: style - Level: warning - Fix: suggestion - Scope: module Reported function firstPositive(values: int32[]): int32 | undefined { for (const value of values) { if (value > 0) { return value; } } return undefined; } Accepted function firstPositive(values: int32[]): int32 | undefined { return values.find((value) => value > 0); } Prior art - Clippy ยท manualfind language/linter/src/rules/style/manualfind.rs:8