From 5a97539793af49cd42c60616c4935fdf24506f52 Mon Sep 17 00:00:00 2001 From: "alexiuk.genius" Date: Thu, 18 Apr 2024 11:37:19 +0200 Subject: [PATCH] Add new lint rule: consider_making_a_member_private_rule.dart --- ...onsider_making_a_member_private_ rule.dart | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/src/lints/consider_making_a_member_private/consider_making_a_member_private_ rule.dart diff --git a/lib/src/lints/consider_making_a_member_private/consider_making_a_member_private_ rule.dart b/lib/src/lints/consider_making_a_member_private/consider_making_a_member_private_ rule.dart new file mode 100644 index 0000000..8c61162 --- /dev/null +++ b/lib/src/lints/consider_making_a_member_private/consider_making_a_member_private_ rule.dart @@ -0,0 +1,30 @@ +import 'package:analyzer/error/listener.dart'; +import 'package:custom_lint_builder/custom_lint_builder.dart'; +import 'package:solid_lints/src/models/rule_config.dart'; +import 'package:solid_lints/src/models/solid_lint_rule.dart'; + +class ConsiderMakingAMemberPrivateRule extends SolidLintRule { + static const lintName = 'consider_making_a_member_private'; + + ConsiderMakingAMemberPrivateRule._(super.config); + + factory ConsiderMakingAMemberPrivateRule.createRule( + CustomLintConfigs configs) { + final rule = RuleConfig( + configs: configs, + name: lintName, + problemMessage: (_) => "Consider making a member private", + ); + + return ConsiderMakingAMemberPrivateRule._(rule); + } + + @override + void run( + CustomLintResolver resolver, + ErrorReporter reporter, + CustomLintContext context, + ) { + // TODO: Implement the rule + } +}