From 6f17bcc28364a8ec712c778bc1e9c5873465d9d1 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Mon, 10 Jun 2024 14:05:54 -0400 Subject: [PATCH] fix: add fixer --- .../oxc_linter/src/rules/eslint/no_useless_constructor.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_constructor.rs b/crates/oxc_linter/src/rules/eslint/no_useless_constructor.rs index bc49a096b8a27..5b1ff47081936 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_constructor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_constructor.rs @@ -123,8 +123,8 @@ fn lint_empty_constructor<'a>( if !body.statements.is_empty() { return; } - ctx.diagnostic_with_fix(no_empty_constructor(constructor.span), || { - Fix::delete(constructor.span) + ctx.diagnostic_with_fix(no_empty_constructor(constructor.span), |fixer| { + fixer.delete_range(constructor.span) }); } @@ -143,8 +143,8 @@ fn lint_redundant_super_call<'a>( if is_only_simple_params(params) && (is_spread_arguments(super_args) || is_passing_through(params, super_args)) { - ctx.diagnostic_with_fix(no_redundant_super_call(constructor.span), || { - Fix::delete(constructor.span) + ctx.diagnostic_with_fix(no_redundant_super_call(constructor.span), |fixer| { + fixer.delete_range(constructor.span) }); } }