analysis_options_user.yaml 3.01 KB
Newer Older
1 2
# Specify analysis options.
#
3 4 5
# Until there are meta linter rules, each desired lint must be explicitly enabled.
# See: https://github.com/dart-lang/linter/issues/288
#
6
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
7 8
# See the configuration guide for more
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
9
#
10 11 12 13 14
# There are three similar analysis options files in the flutter repo:
#   - .analysis_options
#   - .analysis_options_repo
#   - packages/flutter/lib/analysis_options_user.yaml (this file)
#
15
# This file contains the analysis options used by "flutter analyze"
16 17
# and the dartanalyzer when analyzing code outside the flutter repository.
# It isn't named 'analysis_options.yaml' because otherwise editors like Atom
18
# would use it when analyzing the flutter tool itself.
19 20
#
# When editing, make sure you keep /.analysis_options consistent.
21

22
analyzer:
23
  language:
24
    enableStrictCallChecks: true
25
    enableSuperMixins: true
Hixie's avatar
Hixie committed
26
  strong-mode: true
27
  errors:
28 29
    # treat missing required parameters as a warning (not a hint)
    missing_required_param: warning
30 31
    # treat missing returns as a warning (not a hint)
    missing_return: warning
32
    # allow overriding fields (if they use super, ideally...)
33
    strong_mode_invalid_field_override: ignore
34
    # allow having TODOs in the code
35
    todo: ignore
36

37 38
linter:
  rules:
39 40 41
    # these rules are documented on and in the same order as
    # the Dart Lint rules page to make maintenance easier
    # http://dart-lang.github.io/linter/lints/
42

43
    # === error rules ===
44
    - avoid_empty_else
45 46
    - cancel_subscriptions
    - close_sinks
47 48
    # - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
    - control_flow_in_finally
49
    - empty_statements
50
    - hash_and_equals
51 52
    # - invariant_booleans
    # - iterable_contains_unrelated_type
53 54
    # - list_remove_unrelated_type
    # - literal_only_boolean_expressions
55 56 57
    - test_types_in_equals
    - throw_in_finally
    - unrelated_type_equality_checks
58
    - valid_regexps
59

60 61 62 63 64
    # === style rules ===
    # - always_declare_return_types
    # - always_specify_types
    # - annotate_overrides
    # - avoid_as
Ian Hickson's avatar
Ian Hickson committed
65
    - avoid_init_to_null
66
    - avoid_return_types_on_setters
67
    - await_only_futures
68
    - camel_case_types
69
    # - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
70
    - empty_constructor_bodies
71
    - implementation_imports
Ian Hickson's avatar
Ian Hickson committed
72
    - library_names
73 74
    - library_prefixes
    - non_constant_identifier_names
75 76
    # - one_member_abstracts
    # - only_throw_errors
77
    # - overridden_fields
Ian Hickson's avatar
Ian Hickson committed
78 79 80
    - package_api_docs
    - package_prefixed_library_names
    - prefer_is_not_empty
81
    # - public_member_api_docs
82
    - slash_for_doc_comments
83 84
    # - sort_constructors_first
    # - sort_unnamed_constructors_first
85
    - super_goes_last
86
    # - type_annotate_public_apis # subset of always_specify_types
87
    - type_init_formals
88
    # - unawaited_futures
89
    - unnecessary_brace_in_string_interp
Ian Hickson's avatar
Ian Hickson committed
90
    - unnecessary_getters_setters
91

92
    # === pub rules ===
93
    - package_names