Skip to content

Commit

Permalink
rename vars
Browse files Browse the repository at this point in the history
  • Loading branch information
camc314 committed Oct 11, 2023
1 parent e4d783c commit c61e21e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/oxc_linter/src/rules/unicorn/catch_error_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ impl CatchErrorName {
arg0: &Argument,
ctx: &LintContext,
) -> Option<CatchErrorNameDiagnostic> {
if let Argument::Expression(k) = arg0 {
if let Expression::ArrowExpression(a2) = k {
if let Some(arg0) = a2.params.items.get(0) {
if let Argument::Expression(expr) = arg0 {
if let Expression::ArrowExpression(arrow_expr) = expr {
if let Some(arg0) = arrow_expr.params.items.get(0) {
if let BindingPatternKind::BindingIdentifier(v) = &arg0.pattern.kind {
if self.is_name_allowed(&v.name) {
return None;
Expand All @@ -85,7 +85,7 @@ impl CatchErrorName {
}
}

if let Expression::FunctionExpression(fn_expr) = k {
if let Expression::FunctionExpression(fn_expr) = expr {
if let Some(arg0) = fn_expr.params.items.get(0) {
if let BindingPatternKind::BindingIdentifier(binding_ident) = &arg0.pattern.kind
{
Expand Down Expand Up @@ -176,16 +176,16 @@ impl Rule for CatchErrorName {
if let Expression::MemberExpression(member_expr) = &call_expr.callee {
if member_expr.static_property_name() == Some("catch") {
if let Some(arg0) = call_expr.arguments.get(0) {
if let Some(aa) = self.check_function_arguments(arg0, ctx) {
ctx.diagnostic(aa);
if let Some(diagnostic) = self.check_function_arguments(arg0, ctx) {
ctx.diagnostic(diagnostic);
}
}
}

if member_expr.static_property_name() == Some("then") {
if let Some(arg0) = call_expr.arguments.get(1) {
if let Some(aa) = self.check_function_arguments(arg0, ctx) {
ctx.diagnostic(aa);
if let Some(diagnostic) = self.check_function_arguments(arg0, ctx) {
ctx.diagnostic(diagnostic);
}
}
}
Expand Down

0 comments on commit c61e21e

Please sign in to comment.