From 06ed8e65a78bbe526d35bf9aa9ee5bfe6c000e98 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 21 Mar 2023 16:12:26 -0700 Subject: [PATCH] Enable prefer_mixin (#123159) Enable prefer_mixin --- analysis_options.yaml | 2 +- .../flutter_tools/lib/src/base/error_handling_io.dart | 9 ++++++--- .../lib/src/base/multi_root_file_system.dart | 9 ++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 97df0aaed4..0144ea649b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -173,7 +173,7 @@ linter: - prefer_is_not_empty - prefer_is_not_operator - prefer_iterable_whereType - # - prefer_mixin # has false positives, see https://github.com/dart-lang/linter/issues/3018 + - prefer_mixin # - prefer_null_aware_method_calls # "call()" is confusing to people new to the language since it's not documented anywhere - prefer_null_aware_operators - prefer_relative_imports diff --git a/packages/flutter_tools/lib/src/base/error_handling_io.dart b/packages/flutter_tools/lib/src/base/error_handling_io.dart index 044235c1a6..6077159256 100644 --- a/packages/flutter_tools/lib/src/base/error_handling_io.dart +++ b/packages/flutter_tools/lib/src/base/error_handling_io.dart @@ -156,7 +156,8 @@ class ErrorHandlingFileSystem extends ForwardingFileSystem { class ErrorHandlingFile extends ForwardingFileSystemEntity - with ForwardingFile { + // TODO(goderbauer): Fix this ignore when https://github.com/google/file.dart/issues/209 is resolved. + with ForwardingFile { // ignore: prefer_mixin ErrorHandlingFile({ required Platform platform, required this.fileSystem, @@ -368,7 +369,8 @@ class ErrorHandlingFile class ErrorHandlingDirectory extends ForwardingFileSystemEntity - with ForwardingDirectory { + // TODO(goderbauer): Fix this ignore when https://github.com/google/file.dart/issues/209 is resolved. + with ForwardingDirectory { // ignore: prefer_mixin ErrorHandlingDirectory({ required Platform platform, required this.fileSystem, @@ -504,7 +506,8 @@ class ErrorHandlingDirectory class ErrorHandlingLink extends ForwardingFileSystemEntity - with ForwardingLink { + // TODO(goderbauer): Fix this ignore when https://github.com/google/file.dart/issues/209 is resolved. + with ForwardingLink { // ignore: prefer_mixin ErrorHandlingLink({ required Platform platform, required this.fileSystem, diff --git a/packages/flutter_tools/lib/src/base/multi_root_file_system.dart b/packages/flutter_tools/lib/src/base/multi_root_file_system.dart index b74f1e8da1..ee685c77f4 100644 --- a/packages/flutter_tools/lib/src/base/multi_root_file_system.dart +++ b/packages/flutter_tools/lib/src/base/multi_root_file_system.dart @@ -209,7 +209,8 @@ abstract class MultiRootFileSystemEntity - with ForwardingFile { + // TODO(goderbauer): Fix this ignore when https://github.com/google/file.dart/issues/209 is resolved. + with ForwardingFile { // ignore: prefer_mixin MultiRootFile({ required super.fileSystem, required super.delegate, @@ -222,7 +223,8 @@ class MultiRootFile extends MultiRootFileSystemEntity class MultiRootDirectory extends MultiRootFileSystemEntity - with ForwardingDirectory { + // TODO(goderbauer): Fix this ignore when https://github.com/google/file.dart/issues/209 is resolved. + with ForwardingDirectory { // ignore: prefer_mixin MultiRootDirectory({ required super.fileSystem, required super.delegate, @@ -249,7 +251,8 @@ class MultiRootDirectory } class MultiRootLink extends MultiRootFileSystemEntity - with ForwardingLink { + // TODO(goderbauer): Fix this ignore when https://github.com/google/file.dart/issues/209 is resolved. + with ForwardingLink { // ignore: prefer_mixin MultiRootLink({ required super.fileSystem, required super.delegate,