include: package:flutter_lints/flutter.yaml

analyzer:
  exclude:
    - "**/*.g.dart"
    - "**/*.freezed.dart"
    - "mason/**"
  language:
    strict-casts: true
    strict-inference: true
    strict-raw-types: true
  errors:
    missing_required_param: error
    missing_return: error
    todo: ignore

linter:
  rules:
    # 架构规则
    avoid_classes_with_only_static_members: true
    prefer_final_fields: true

    # 代码风格
    prefer_single_quotes: true
    require_trailing_commas: true
    sort_child_properties_last: true
    prefer_const_constructors: true
    prefer_const_declarations: true
    prefer_const_literals_to_create_immutables: true
    prefer_final_locals: true

    # 命名规则
    camel_case_types: true
    non_constant_identifier_names: true
    constant_identifier_names: true

    # 代码质量
    avoid_print: true
    avoid_empty_else: true
    no_duplicate_case_values: true
    unawaited_futures: true
    avoid_unnecessary_containers: true

    # 性能
    avoid_function_literals_in_foreach_calls: true
    prefer_collection_literals: true

    # 安全性
    avoid_web_libraries_in_flutter: true
