diff --git a/CHANGELOG.md b/CHANGELOG.md index 6248f580c7..666f767704 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ ## Unreleased * **Breaking Change:** cli arguments `--fatal-unused` and `--fatal-warnings` activate by default. -* chore: restrict `analyzer` version to `>=2.8.0 <3.3.0`. +* chore: restrict `analyzer` version to `>=3.3.0 <3.4.0`. +* chore: restrict `analyzer_plugin` version to `>=0.9.0 <0.10.0`. * feat: add static code diagnostic `avoid-collection-methods-with-unrelated-types` ## 4.11.0 diff --git a/analysis_options.yaml b/analysis_options.yaml index e04ac038b1..240a826e28 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -70,7 +70,8 @@ dart_code_metrics: exceptions: - id - ok - - prefer-correct-type-name + - prefer-correct-type-name: + max-length: 44 - prefer-first - prefer-last - prefer-match-file-name: diff --git a/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_collection_methods_with_unrelated_types/avoid_collection_methods_with_unrelated_types_rule.dart b/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_collection_methods_with_unrelated_types/avoid_collection_methods_with_unrelated_types_rule.dart index 7f82b05727..72a0fa9e15 100644 --- a/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_collection_methods_with_unrelated_types/avoid_collection_methods_with_unrelated_types_rule.dart +++ b/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_collection_methods_with_unrelated_types/avoid_collection_methods_with_unrelated_types_rule.dart @@ -22,9 +22,9 @@ class AvoidCollectionMethodsWithUnrelatedTypesRule extends CommonRule { static const _warning = 'Avoid collection methods with unrelated types.'; - AvoidCollectionMethodsWithUnrelatedTypesRule( - [Map config = const {}]) - : super( + AvoidCollectionMethodsWithUnrelatedTypesRule([ + Map config = const {}, + ]) : super( id: ruleId, severity: readSeverity(config, Severity.warning), excludes: readExcludes(config), diff --git a/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_returning_widgets/visitor.dart b/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_returning_widgets/visitor.dart index 456e5be364..f852ff6f10 100644 --- a/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_returning_widgets/visitor.dart +++ b/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_returning_widgets/visitor.dart @@ -36,7 +36,7 @@ class _Visitor extends RecursiveAstVisitor { @override void visitClassDeclaration(ClassDeclaration node) { - final classType = node.extendsClause?.superclass2.type; + final classType = node.extendsClause?.superclass.type; if (!isWidgetOrSubclass(classType) && !isWidgetStateOrSubclass(classType)) { return; } diff --git a/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_unnecessary_setstate/visitor.dart b/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_unnecessary_setstate/visitor.dart index 4b220889a8..8bb6ba0d6e 100644 --- a/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_unnecessary_setstate/visitor.dart +++ b/lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_unnecessary_setstate/visitor.dart @@ -14,7 +14,7 @@ class _Visitor extends RecursiveAstVisitor { void visitClassDeclaration(ClassDeclaration node) { super.visitClassDeclaration(node); - final type = node.extendsClause?.superclass2.type; + final type = node.extendsClause?.superclass.type; if (type == null || !isWidgetStateOrSubclass(type)) { return; } diff --git a/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_extracting_callbacks/visitor.dart b/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_extracting_callbacks/visitor.dart index 64bce38799..ac0147326c 100644 --- a/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_extracting_callbacks/visitor.dart +++ b/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_extracting_callbacks/visitor.dart @@ -11,7 +11,7 @@ class _Visitor extends SimpleAstVisitor { @override void visitClassDeclaration(ClassDeclaration node) { - final classType = node.extendsClause?.superclass2.type; + final classType = node.extendsClause?.superclass.type; if (!isWidgetOrSubclass(classType) && !isWidgetStateOrSubclass(classType)) { return; } diff --git a/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_single_widget_per_file/visitor.dart b/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_single_widget_per_file/visitor.dart index 09f4746ef3..a55d2842d3 100644 --- a/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_single_widget_per_file/visitor.dart +++ b/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_single_widget_per_file/visitor.dart @@ -15,7 +15,7 @@ class _Visitor extends SimpleAstVisitor { void visitClassDeclaration(ClassDeclaration node) { super.visitClassDeclaration(node); - final classType = node.extendsClause?.superclass2.type; + final classType = node.extendsClause?.superclass.type; if (isWidgetOrSubclass(classType) && (!_ignorePrivateWidgets || !Identifier.isPrivateName(node.name.name))) { _nodes.add(node); diff --git a/pubspec.yaml b/pubspec.yaml index f4fa5fd492..c1139d35e3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,8 +10,8 @@ environment: sdk: ">=2.14.0 <3.0.0" dependencies: - analyzer: ">=2.8.0 <3.3.0" - analyzer_plugin: ">=0.8.0 <0.10.0" + analyzer: ">=3.3.0 <3.4.0" + analyzer_plugin: ">=0.9.0 <0.10.0" ansicolor: ^2.0.1 args: ^2.0.0 collection: ^1.15.0 diff --git a/website/docs/cli/check-unused-files.md b/website/docs/cli/check-unused-files.md index f1f70b9dda..73affee59b 100644 --- a/website/docs/cli/check-unused-files.md +++ b/website/docs/cli/check-unused-files.md @@ -54,7 +54,7 @@ The reporter prints a single JSON object containing meta information and the unu - `formatVersion` - an integer representing the format version (will be incremented each time the serialization format changes) - `timestamp` - a creation time of the report in YYYY-MM-DD HH:MM:SS format -- `unusedFiles` - an array of [unused files](#the-unusedFiles-object-fields-are) +- `unusedFiles` - an array of [unused files](#the-unused-files-object-fields-are) - `automaticallyDeleted` - an indication of unused files being automatically deleted ```JSON @@ -76,7 +76,7 @@ The reporter prints a single JSON object containing meta information and the unu } ``` -#### The **unusedFiles** object fields are {#the-unusedfiles-object-fields-are} +#### The **unusedFiles** object fields are {#the-unused-files-object-fields-are} - `path` - a relative path of the unused file