Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oxc/only used in recursion "bad" example doesn't cause an error #4811

Closed
camc314 opened this issue Aug 10, 2024 · 2 comments · Fixed by #6029
Closed

oxc/only used in recursion "bad" example doesn't cause an error #4811

camc314 opened this issue Aug 10, 2024 · 2 comments · Fixed by #6029
Assignees
Labels
A-linter Area - Linter C-bug Category - Bug

Comments

@camc314
Copy link
Contributor

camc314 commented Aug 10, 2024

In the docs for oxc/only used in recursion, there's the following case:

function f(a: number, b: number): number {
    if (a == 0) {
        return 1
    } else {
        return f(a - 1, b + 1)
    }
}

this doesn't report an error if you run this code against the lint rule 😅

to complete this issue we should make it report the error for this case.

@camc314 camc314 added the A-linter Area - Linter label Aug 10, 2024
@camc314 camc314 self-assigned this Aug 10, 2024
@DonIsaac
Copy link
Contributor

I wonder if we should have our (almost added) documentation tests run the lint rule against incorrect examples 🤔

@DonIsaac DonIsaac added the C-bug Category - Bug label Aug 10, 2024
@camc314
Copy link
Contributor Author

camc314 commented Aug 10, 2024

I wonder if we should have our (almost added) documentation tests run the lint rule against incorrect examples 🤔

that'd be pretty sweet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-bug Category - Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants