analysis_options_user.yaml 2.88 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 four similar analysis options files in the flutter repos:
11
#   - analysis_options.yaml
12
#   - packages/flutter/lib/analysis_options_user.yaml (this file)
13 14
#   - https://github.com/flutter/plugins/blob/master/analysis_options.yaml
#   - https://github.com/flutter/engine/blob/master/analysis_options.yaml
15
#
16 17 18 19
# This file contains the analysis options used by "flutter analyze" and the
# dartanalyzer when analyzing code outside the flutter repository. It isn't named
# 'analysis_options.yaml' because otherwise editors would use it when analyzing
# the flutter tool itself.
20
#
21
# When editing, make sure you keep this and /analysis_options.yaml consistent.
22

23
analyzer:
24 25
  language:
    enableSuperMixins: true
26
  errors:
27 28
    # treat missing required parameters as a warning (not a hint)
    missing_required_param: warning
29
    # allow having TODOs in the code
30
    todo: ignore
31

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