From 96e53f9670446215b89b5b7787556115fe8551c6 Mon Sep 17 00:00:00 2001 From: solid-glebvorobey <132369081+solid-glebvorobey@users.noreply.github.com> Date: Thu, 19 Sep 2024 02:45:45 +0200 Subject: [PATCH] Add import as instead of hide --- .../avoid_unnecessary_type_assertions_rule.dart | 2 +- .../avoid_unnecessary_type_assertions_fix.dart | 4 ++-- .../double_literal_format_rule.dart | 2 +- .../fixes/double_literal_format_fix.dart | 4 ++-- lib/src/models/rule_config.dart | 4 ++-- lib/src/utils/parameter_utils.dart | 14 +++++++------- pubspec.yaml | 3 --- 7 files changed, 15 insertions(+), 18 deletions(-) diff --git a/lib/src/lints/avoid_unnecessary_type_assertions/avoid_unnecessary_type_assertions_rule.dart b/lib/src/lints/avoid_unnecessary_type_assertions/avoid_unnecessary_type_assertions_rule.dart index 20d088c9..c973b609 100644 --- a/lib/src/lints/avoid_unnecessary_type_assertions/avoid_unnecessary_type_assertions_rule.dart +++ b/lib/src/lints/avoid_unnecessary_type_assertions/avoid_unnecessary_type_assertions_rule.dart @@ -1,6 +1,6 @@ import 'package:analyzer/dart/ast/ast.dart'; import 'package:analyzer/dart/element/type.dart'; -import 'package:analyzer/error/error.dart'; +import 'package:analyzer/error/error.dart' as error; import 'package:analyzer/error/listener.dart'; import 'package:analyzer/source/source_range.dart'; import 'package:custom_lint_builder/custom_lint_builder.dart'; diff --git a/lib/src/lints/avoid_unnecessary_type_assertions/fixes/avoid_unnecessary_type_assertions_fix.dart b/lib/src/lints/avoid_unnecessary_type_assertions/fixes/avoid_unnecessary_type_assertions_fix.dart index 90c1c91d..40afae08 100644 --- a/lib/src/lints/avoid_unnecessary_type_assertions/fixes/avoid_unnecessary_type_assertions_fix.dart +++ b/lib/src/lints/avoid_unnecessary_type_assertions/fixes/avoid_unnecessary_type_assertions_fix.dart @@ -8,8 +8,8 @@ class _UnnecessaryTypeAssertionsFix extends DartFix { CustomLintResolver resolver, ChangeReporter reporter, CustomLintContext context, - AnalysisError analysisError, - List others, + error.AnalysisError analysisError, + List others, ) { context.registry.addIsExpression((node) { if (analysisError.sourceRange.intersects(node.sourceRange)) { diff --git a/lib/src/lints/double_literal_format/double_literal_format_rule.dart b/lib/src/lints/double_literal_format/double_literal_format_rule.dart index d32664b4..45429ef4 100644 --- a/lib/src/lints/double_literal_format/double_literal_format_rule.dart +++ b/lib/src/lints/double_literal_format/double_literal_format_rule.dart @@ -1,4 +1,4 @@ -import 'package:analyzer/error/error.dart'; +import 'package:analyzer/error/error.dart' as error; import 'package:analyzer/error/listener.dart'; import 'package:analyzer/source/source_range.dart'; import 'package:custom_lint_builder/custom_lint_builder.dart'; diff --git a/lib/src/lints/double_literal_format/fixes/double_literal_format_fix.dart b/lib/src/lints/double_literal_format/fixes/double_literal_format_fix.dart index 2bc7e874..6452df89 100644 --- a/lib/src/lints/double_literal_format/fixes/double_literal_format_fix.dart +++ b/lib/src/lints/double_literal_format/fixes/double_literal_format_fix.dart @@ -8,8 +8,8 @@ class _DoubleLiteralFormatFix extends DartFix { CustomLintResolver resolver, ChangeReporter reporter, CustomLintContext context, - AnalysisError analysisError, - List others, + error.AnalysisError analysisError, + List others, ) { context.registry.addDoubleLiteral((node) { // checks that the literal declaration is where our warning is located diff --git a/lib/src/models/rule_config.dart b/lib/src/models/rule_config.dart index d2429b9d..23f08f39 100644 --- a/lib/src/models/rule_config.dart +++ b/lib/src/models/rule_config.dart @@ -1,4 +1,4 @@ -import 'package:analyzer/error/error.dart'; +import 'package:analyzer/error/error.dart' as error; import 'package:custom_lint_builder/custom_lint_builder.dart'; /// Type definition of a value factory which allows us to map data from @@ -38,6 +38,6 @@ class RuleConfig { LintCode get lintCode => LintCode( name: name, problemMessage: _problemMessageFactory(parameters), - errorSeverity: ErrorSeverity.WARNING, + errorSeverity: error.ErrorSeverity.WARNING, ); } diff --git a/lib/src/utils/parameter_utils.dart b/lib/src/utils/parameter_utils.dart index fdbd647c..df045978 100644 --- a/lib/src/utils/parameter_utils.dart +++ b/lib/src/utils/parameter_utils.dart @@ -1,5 +1,5 @@ import 'package:analyzer/dart/ast/ast.dart'; -import 'package:analyzer/error/error.dart'; +import 'package:analyzer/error/error.dart' as error; import 'package:custom_lint_builder/custom_lint_builder.dart'; /// Checks if parameter name consists only of underscores @@ -12,12 +12,12 @@ bool nameConsistsOfUnderscoresOnly(FormalParameter parameter) { } /// Decodes the severity parameter from the string -ErrorSeverity? decodeErrorSeverity(String? severity) { +error.ErrorSeverity? decodeErrorSeverity(String? severity) { return switch (severity?.toLowerCase()) { - 'info' => ErrorSeverity.INFO, - 'warning' => ErrorSeverity.WARNING, - 'error' => ErrorSeverity.ERROR, - 'none' => ErrorSeverity.NONE, + 'info' => error.ErrorSeverity.INFO, + 'warning' => error.ErrorSeverity.WARNING, + 'error' => error.ErrorSeverity.ERROR, + 'none' => error.ErrorSeverity.NONE, _ => null, }; } @@ -31,7 +31,7 @@ extension LintCodeCopyWith on LintCode { String? correctionMessage, String? uniqueName, String? url, - ErrorSeverity? errorSeverity, + error.ErrorSeverity? errorSeverity, }) => LintCode( name: name ?? this.name, diff --git a/pubspec.yaml b/pubspec.yaml index d2b769f9..4a3f3291 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,6 +24,3 @@ dev_dependencies: flutter: sdk: flutter test: ^1.24.6 - -dependency_overrides: - analyzer: ^6.6.0