From 148c7a8b822ab46ee971d595b80031353db28552 Mon Sep 17 00:00:00 2001 From: kaykdm <34934746+kaykdm@users.noreply.github.com> Date: Sun, 15 Sep 2024 20:36:13 +0900 Subject: [PATCH] =?UTF-8?q?fix(linter):=20replace=20bitwise=20AND=20(&)=20?= =?UTF-8?q?with=20logical=20AND=20(&&)=20in=20explici=E2=80=A6=20(#5780)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …t_function_return_type rule This PR fixes an issue where the Bitwise AND (&) operator was mistakenly used in a conditional statement, instead of the Logical AND (&&) operator. --- .../src/rules/typescript/explicit_function_return_type.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs b/crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs index 8b3bc2517..1802c7dc8 100644 --- a/crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs +++ b/crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs @@ -164,7 +164,7 @@ impl Rule for ExplicitFunctionReturnType { fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) { match node.kind() { AstKind::Function(func) => { - if !func.is_declaration() & !func.is_expression() { + if !func.is_declaration() && !func.is_expression() { return; }