Skip to content

Commit

Permalink
Add import as instead of hide
Browse files Browse the repository at this point in the history
  • Loading branch information
solid-glebvorobey committed Sep 19, 2024
1 parent b328197 commit 96e53f9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class _UnnecessaryTypeAssertionsFix extends DartFix {
CustomLintResolver resolver,
ChangeReporter reporter,
CustomLintContext context,
AnalysisError analysisError,
List<AnalysisError> others,
error.AnalysisError analysisError,
List<error.AnalysisError> others,
) {
context.registry.addIsExpression((node) {
if (analysisError.sourceRange.intersects(node.sourceRange)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class _DoubleLiteralFormatFix extends DartFix {
CustomLintResolver resolver,
ChangeReporter reporter,
CustomLintContext context,
AnalysisError analysisError,
List<AnalysisError> others,
error.AnalysisError analysisError,
List<error.AnalysisError> others,
) {
context.registry.addDoubleLiteral((node) {
// checks that the literal declaration is where our warning is located
Expand Down
4 changes: 2 additions & 2 deletions lib/src/models/rule_config.dart
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -38,6 +38,6 @@ class RuleConfig<T extends Object?> {
LintCode get lintCode => LintCode(
name: name,
problemMessage: _problemMessageFactory(parameters),
errorSeverity: ErrorSeverity.WARNING,
errorSeverity: error.ErrorSeverity.WARNING,
);
}
14 changes: 7 additions & 7 deletions lib/src/utils/parameter_utils.dart
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
};
}
Expand All @@ -31,7 +31,7 @@ extension LintCodeCopyWith on LintCode {
String? correctionMessage,
String? uniqueName,
String? url,
ErrorSeverity? errorSeverity,
error.ErrorSeverity? errorSeverity,
}) =>
LintCode(
name: name ?? this.name,
Expand Down
3 changes: 0 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ dev_dependencies:
flutter:
sdk: flutter
test: ^1.24.6

dependency_overrides:
analyzer: ^6.6.0

0 comments on commit 96e53f9

Please sign in to comment.