Skip to content

Commit

Permalink
refactor(linter/prefer_number_properties): remove the unused `Identif…
Browse files Browse the repository at this point in the history
…ierName` check
  • Loading branch information
Boshen committed Jun 22, 2024
1 parent a1b2d83 commit cbe82ab
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions crates/oxc_linter/src/rules/unicorn/prefer_number_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cbe82ab

Please sign in to comment.