Rules
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
[1, 2, 3].filter(x => x > 1)[0];
[1, 2, 3].filter(x => x > 1).at(0);[1, 2, 3].find(x => x > 1);Popular · 1 of 29
Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result
[1, 2, 3].filter(x => x > 1)[0];
[1, 2, 3].filter(x => x > 1).at(0);[1, 2, 3].find(x => x > 1);