You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed [#7233](https://github.com/biomejs/biome/issues/7233): The useIndexOf rule now correctly suggests using indexOf() instead of findIndex().
6
+
7
+
The diagnostic message was incorrectly recommending Array#findIndex() over Array#indexOf(), when it should recommend the opposite for simple equality checks.
Copy file name to clipboardExpand all lines: crates/biome_js_analyze/src/lint/complexity/use_index_of.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -175,7 +175,7 @@ impl Rule for UseIndexOf {
175
175
rule_category!(),
176
176
node.range(),
177
177
markup!{
178
-
"Prefer "<Emphasis>"Array#"{old_member_name}"()"</Emphasis>" over "<Emphasis>"Array#"{new_member_name}"()"</Emphasis>" when looking for the index of an item.`"
178
+
"Prefer "<Emphasis>"Array#"{new_member_name}"()"</Emphasis>" over "<Emphasis>"Array#"{old_member_name}"()"</Emphasis>" when looking for the index of an item."
179
179
},
180
180
).note(markup!{
181
181
"This callback only tests for equality against a single value. This value can be passed directly to "<Emphasis>""{new_member_name}"()"</Emphasis>" instead."
0 commit comments