linter: Rework only_used_in_recursion detection logic #7275
Labels
A-linter
Area - Linter
C-enhancement
Category - New feature or request
good first issue
Experience Level - Good for newcomers
What version of Oxlint are you using?
No response
What command did you run?
No response
What does your
.oxlint.json
config file look like?No response
What happened?
To improve detection, I propose modifying the algorithm to support a wider range of patterns, including multi-node expressions and cases with more complex references.
The current detection logic is conservative and based on the following conditions:
recurfunc(arg)
, and not a multi-node expression, e.g.,recurfunc(arg + 1)
.Due to this, the following cases are not detected by the current implementation:
Clippy's implementation avoids issuing warnings for expressions with side effects.
We might consider adopting a similar approach in our implementation.
The text was updated successfully, but these errors were encountered: