analysis_options_user.yaml 2.94 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
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 having TODOs in the code
33
    todo: ignore
34

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