From e867c290865a12c5d6966625cf2380e72146df06 Mon Sep 17 00:00:00 2001 From: Faris Armoush Date: Thu, 12 Jun 2025 14:30:39 +0300 Subject: [PATCH] use `very_good_analysis` lints. --- analysis_options.yaml | 48 ++++++++----------- macos/Flutter/GeneratedPluginRegistrant.swift | 2 +- pubspec.yaml | 7 +-- 3 files changed, 23 insertions(+), 34 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 80a63bcb..611cf313 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,33 +1,27 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. +include: package:very_good_analysis/analysis_options.yaml -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. analyzer: errors: - constant_identifier_names: ignore - overridden_fields: ignore -include: package:flutter_lints/flutter.yaml + strict_raw_type: warning + argument_type_not_assignable: warning + invalid_assignment: warning + return_of_invalid_type: warning + return_of_invalid_type_from_closure: warning + list_element_type_not_assignable: warning + for_in_of_invalid_type: warning + cast_nullable_to_non_nullable: warning + non_bool_condition: warning + field_initializer_not_assignable: warning + non_bool_negation_expression: warning + non_bool_operand: warning linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - prefer_const_constructors: true - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options + prefer_single_quotes: true + avoid_print: false + public_member_api_docs: false + sort_pub_dependencies: false + one_member_abstracts: false + prefer_int_literals: false + sort_constructors_first: false + avoid_redundant_argument_values: false diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index e6f3527d..585688ef 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -15,7 +15,7 @@ import shared_preferences_foundation import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - FLTFirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAnalyticsPlugin")) + FirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FirebaseAnalyticsPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin")) FLTFirebaseDatabasePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseDatabasePlugin")) diff --git a/pubspec.yaml b/pubspec.yaml index edd003cf..c4692ac4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -69,12 +69,7 @@ dev_dependencies: flutter_test: sdk: flutter - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^5.0.0 + very_good_analysis: ^9.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec