diff --git a/lib/lints/avoid_unnecessary_type_casts/avoid_unnecessary_type_casts_rule.dart b/lib/lints/avoid_unnecessary_type_casts/avoid_unnecessary_type_casts_rule.dart index 97a3690c..e6ccbeeb 100644 --- a/lib/lints/avoid_unnecessary_type_casts/avoid_unnecessary_type_casts_rule.dart +++ b/lib/lints/avoid_unnecessary_type_casts/avoid_unnecessary_type_casts_rule.dart @@ -36,9 +36,8 @@ class AvoidUnnecessaryTypeCastsRule extends SolidLintRule { ErrorReporter reporter, CustomLintContext context, ) { - final visitor = AvoidUnnecessaryTypeCastsVisitor(); - context.registry.addAsExpression((node) { + final visitor = AvoidUnnecessaryTypeCastsVisitor(); visitor.visitAsExpression(node); for (final element in visitor.expressions.entries) { diff --git a/lib/lints/avoid_unrelated_type_assertions/avoid_unrelated_type_assertions_rule.dart b/lib/lints/avoid_unrelated_type_assertions/avoid_unrelated_type_assertions_rule.dart index aa102f9c..117cc49f 100644 --- a/lib/lints/avoid_unrelated_type_assertions/avoid_unrelated_type_assertions_rule.dart +++ b/lib/lints/avoid_unrelated_type_assertions/avoid_unrelated_type_assertions_rule.dart @@ -34,9 +34,8 @@ class AvoidUnrelatedTypeAssertionsRule extends SolidLintRule { ErrorReporter reporter, CustomLintContext context, ) { - final visitor = AvoidUnrelatedTypeAssertionsVisitor(); - context.registry.addIsExpression((node) { + final visitor = AvoidUnrelatedTypeAssertionsVisitor(); visitor.visitIsExpression(node); for (final element in visitor.expressions.entries) { diff --git a/lib/lints/newline_before_return/newline_before_return_rule.dart b/lib/lints/newline_before_return/newline_before_return_rule.dart index c965f359..f97ba0ac 100644 --- a/lib/lints/newline_before_return/newline_before_return_rule.dart +++ b/lib/lints/newline_before_return/newline_before_return_rule.dart @@ -56,9 +56,8 @@ class NewlineBeforeReturnRule extends SolidLintRule { ErrorReporter reporter, CustomLintContext context, ) { - final visitor = NewLineBeforeReturnVisitor(resolver.lineInfo); - context.registry.addReturnStatement((node) { + final visitor = NewLineBeforeReturnVisitor(resolver.lineInfo); visitor.visitReturnStatement(node); for (final element in visitor.statements) {