.analysis_options 2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# Specify analysis options.

# This file is the .analysis_options file used by Flutter editors, such as
# Atom. It is very similar to flutter_tools/flutter_analysis_options; the only
# difference (currently) is the public_member_api_docs option, which triggers
# too many messages to be used in editors.

analyzer:
  language:
    enableStrictCallChecks: true
    enableSuperMixins: true
  strong-mode: true
  errors:
    # we allow overriding fields (if they use super, ideally...)
    strong_mode_invalid_field_override: ignore
    # we allow type narrowing
    strong_mode_invalid_method_override: ignore
    strong_mode_static_type_error: ignore
    strong_mode_down_cast_composite: ignore
    # we allow having TODOs in the code
    todo: ignore
22

23 24
linter:
  rules:
25 26 27 28
    # these are in the same order as http://dart-lang.github.io/linter/lints/
    # to make maintenance easier

    # error rules
29
    - avoid_empty_else
30 31 32 33 34 35 36 37 38
    # - comment_references
    - control_flow_in_finally
    - hash_and_equals
    # - iterable_contains_unrelated_type
    - test_types_in_equals
    - throw_in_finally
    - unrelated_type_equality_checks

    # style rules
39 40 41 42 43
    - always_declare_return_types
    - always_specify_types
    - annotate_overrides
    - avoid_as
    - avoid_init_to_null
44 45
    - avoid_return_types_on_setters
    - await_only_futures
46
    - camel_case_types
47 48
    # - constant_identifier_names
    - control_flow_in_finally
49
    - empty_constructor_bodies
50
    - implementation_imports
51 52 53
    - library_names
    - library_prefixes
    - non_constant_identifier_names
54 55
    - one_member_abstracts
    # - overriden_field
56 57 58
    - package_api_docs
    - package_prefixed_library_names
    - prefer_is_not_empty
59
    # - public_member_api_docs
60 61 62 63
    - slash_for_doc_comments
    - sort_constructors_first
    - sort_unnamed_constructors_first
    - super_goes_last
64
    # - type_annotate_public_apis # subset of always_specify_types
65 66 67
    - type_init_formals
    - unnecessary_brace_in_string_interp
    - unnecessary_getters_setters
68 69 70

    # pub rules
    - package_names