# Flutter 代码分析配置 include: package:flutter_lints/flutter.yaml linter: rules: # 强烈推荐的规则 - always_declare_return_types - avoid_empty_else - avoid_print - avoid_relative_lib_imports - avoid_returning_null_for_future - await_only_futures - camel_case_types - cancel_subscriptions - close_sinks - constant_identifier_names - empty_catches - empty_constructor_bodies - empty_statements - hash_and_equals - implementation_imports - library_names - library_prefixes - no_duplicate_case_values - non_constant_identifier_names - null_closures - prefer_const_constructors - prefer_const_declarations - prefer_final_fields - prefer_is_empty - prefer_is_not_empty - prefer_typing_uninitialized_variables - sort_constructors_first - type_init_formals - unnecessary_brace_in_string_interps - unnecessary_const - unnecessary_new - unnecessary_null_in_if_null_operators - unnecessary_this - unrelated_type_equality_checks - valid_regexps # 性能相关 - avoid_slow_async_io - prefer_final_in_for_each # 代码风格 - prefer_single_quotes - require_trailing_commas analyzer: exclude: - "**/*.g.dart" - "**/*.freezed.dart" - "build/**" errors: # 将某些 lint 错误提升为 error 级别 missing_required_param: error missing_return: error valid_regexps: error