From 21cdb784d6ae63a9768c75d3b5d7f3caba4b672a Mon Sep 17 00:00:00 2001 From: Boshen <1430279+Boshen@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:47:41 +0000 Subject: [PATCH] docs(linter): fix incorrect "bad" example in `only-used-in-recursion` (#6029) closes #4811 --- crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs b/crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs index 94bb1cffce38f..f3ff5ce9487f0 100644 --- a/crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs +++ b/crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs @@ -40,12 +40,8 @@ declare_oxc_lint!( /// /// Examples of **incorrect** code for this rule: /// ```ts - /// function f(a: number, b: number): number { - /// if (a == 0) { - /// return 1 - /// } else { - /// return f(a - 1, b + 1) - /// } + /// function test(only_used_in_recursion) { + /// return test(only_used_in_recursion); /// } /// ``` ///