From 7302429b2bdf6ef3b17603fd6d26241b1cd7d701 Mon Sep 17 00:00:00 2001 From: Boshen <1430279+Boshen@users.noreply.github.com> Date: Sat, 22 Jun 2024 09:40:02 +0000 Subject: [PATCH] refactor(linter/prefer_number_properties): remove the unused `IdentifierName` check (#3822) --- .../rules/unicorn/prefer_number_properties.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/crates/oxc_linter/src/rules/unicorn/prefer_number_properties.rs b/crates/oxc_linter/src/rules/unicorn/prefer_number_properties.rs index 396d56c92..62e2041e0 100644 --- a/crates/oxc_linter/src/rules/unicorn/prefer_number_properties.rs +++ b/crates/oxc_linter/src/rules/unicorn/prefer_number_properties.rs @@ -83,24 +83,6 @@ impl Rule for PreferNumberProperties { } _ => {} }, - AstKind::IdentifierName(ident_name) => { - if matches!( - ctx.nodes().parent_kind(node.id()), - Some(AstKind::MemberExpression(_) | AstKind::PropertyKey(_)) - ) { - return; - }; - - match ident_name.name.as_str() { - "NaN" | "Infinity" => { - ctx.diagnostic(prefer_number_properties_diagnostic( - ident_name.span, - &ident_name.name, - )); - } - _ => {} - } - } AstKind::CallExpression(call_expr) => { let Some(ident_name) = extract_ident_from_expression(&call_expr.callee) else { return;