analysis_options_user.yaml 2.89 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
# There are three similar analysis options files in the flutter repo:
11 12
#   - analysis_options.yaml
#   - analysis_options_repo.yaml
13 14
#   - 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.yaml consistent.
21

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

36 37
linter:
  rules:
38 39
    # these rules are documented on and in the same order as
    # the Dart Lint rules page to make maintenance easier
40
    # https://github.com/dart-lang/linter/blob/master/example/all.yaml
41 42 43 44
    # - always_declare_return_types
    # - always_specify_types
    # - annotate_overrides
    # - avoid_as
45
    - avoid_empty_else
Ian Hickson's avatar
Ian Hickson committed
46
    - avoid_init_to_null
47
    - avoid_return_types_on_setters
48
    - await_only_futures
49
    - camel_case_types
50 51 52
    - cancel_subscriptions
    - close_sinks
    # - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
53
    # - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
54
    - control_flow_in_finally
55
    - empty_constructor_bodies
56 57
    - empty_statements
    - hash_and_equals
58
    - implementation_imports
59 60
    # - invariant_booleans
    # - iterable_contains_unrelated_type
Ian Hickson's avatar
Ian Hickson committed
61
    - library_names
62
    # - library_prefixes
63 64
    # - list_remove_unrelated_type
    # - literal_only_boolean_expressions
65
    - non_constant_identifier_names
66 67
    # - one_member_abstracts
    # - only_throw_errors
68
    # - overridden_fields
Ian Hickson's avatar
Ian Hickson committed
69
    - package_api_docs
70
    - package_names
Ian Hickson's avatar
Ian Hickson committed
71 72
    - package_prefixed_library_names
    - prefer_is_not_empty
73
    # - public_member_api_docs
74
    - slash_for_doc_comments
75 76
    # - sort_constructors_first
    # - sort_unnamed_constructors_first
77
    - super_goes_last
78 79
    - test_types_in_equals
    - throw_in_finally
80
    # - type_annotate_public_apis # subset of always_specify_types
81
    - type_init_formals
82
    # - unawaited_futures
83
    - unnecessary_brace_in_string_interps
Ian Hickson's avatar
Ian Hickson committed
84
    - unnecessary_getters_setters
85 86
    - unrelated_type_equality_checks
    - valid_regexps