diff --git a/pkg/analyzer/analysis_options.yaml b/pkg/analyzer/analysis_options.yaml index 89a3db64244c..24ce13d4b8f7 100644 --- a/pkg/analyzer/analysis_options.yaml +++ b/pkg/analyzer/analysis_options.yaml @@ -18,5 +18,6 @@ linter: rules: - avoid_unused_constructor_parameters - empty_statements + - prefer_typing_uninitialized_variables - unnecessary_brace_in_string_interps - unnecessary_parenthesis diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart index d52a6e1fd571..f2844c6755f6 100644 --- a/pkg/analyzer/lib/src/dart/analysis/driver.dart +++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart @@ -2278,7 +2278,7 @@ class _DiscoverAvailableFilesTask { /// Information about an exception and its context. class _ExceptionState { - final exception; + final Object exception; final StackTrace stackTrace; /// The key under which the context of the exception was stored, or `null` diff --git a/pkg/analyzer/lib/src/error/best_practices_verifier.dart b/pkg/analyzer/lib/src/error/best_practices_verifier.dart index 60696721c6e6..38391220eacb 100644 --- a/pkg/analyzer/lib/src/error/best_practices_verifier.dart +++ b/pkg/analyzer/lib/src/error/best_practices_verifier.dart @@ -1526,9 +1526,9 @@ class _InvalidAccessVerifier { } AstNode grandparent = parent?.parent; - var element; - var name; - var node; + Element element; + String name; + AstNode node; if (grandparent is ConstructorName) { element = grandparent.staticElement;