refactor(linter/prefer_number_properties): remove the unused IdentifierName check (#3822)

This commit is contained in:
Boshen 2024-06-22 09:40:02 +00:00
parent a1b2d83ea9
commit 7302429b2b

View file

@ -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;