blob: f4b2c47d835d271788543f8a77ab834f63c42b68 [file] [log] [blame]
krisgiesing07b5f832016-05-04 10:15:15 -07001# Specify analysis options.
Dan Rubel57843852016-09-09 13:37:56 -04002#
3# Until there are meta linter rules, each desired lint must be explicitly enabled.
4# See: https://github.com/dart-lang/linter/issues/288
5#
6# For a list of lints, see: http://dart-lang.github.io/linter/lints/
7# See the configuration guide for more
8# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
9#
Dan Rubel3ed33902016-09-07 22:41:59 -040010# This file contains the analysis options used by Flutter editors, such as Atom.
11# It is very similar to .analysis_options_flutter_analyze;
12# the only difference (currently) is the public_member_api_docs option,
13# which triggers too many messages to be used in editors.
krisgiesing07b5f832016-05-04 10:15:15 -070014
15analyzer:
16 language:
17 enableStrictCallChecks: true
18 enableSuperMixins: true
19 strong-mode: true
20 errors:
Dan Rubel57843852016-09-09 13:37:56 -040021 # allow overriding fields (if they use super, ideally...)
krisgiesing07b5f832016-05-04 10:15:15 -070022 strong_mode_invalid_field_override: ignore
Dan Rubel57843852016-09-09 13:37:56 -040023 # allow type narrowing
krisgiesing07b5f832016-05-04 10:15:15 -070024 strong_mode_invalid_method_override: ignore
25 strong_mode_static_type_error: ignore
26 strong_mode_down_cast_composite: ignore
Dan Rubel57843852016-09-09 13:37:56 -040027 # allow having TODOs in the code
krisgiesing07b5f832016-05-04 10:15:15 -070028 todo: ignore
Devon Carew207451f2016-08-18 19:11:39 -070029 exclude:
30 - 'bin/**'
Ian Hickson94636bd2016-05-20 14:08:46 -070031
krisgiesing07b5f832016-05-04 10:15:15 -070032linter:
33 rules:
Dan Rubel57843852016-09-09 13:37:56 -040034 # these rules are documented on and in the same order as
35 # the Dart Lint rules page to make maintenance easier
36 # http://dart-lang.github.io/linter/lints/
Ian Hickson94636bd2016-05-20 14:08:46 -070037
Dan Rubel57843852016-09-09 13:37:56 -040038 # === error rules ===
krisgiesing07b5f832016-05-04 10:15:15 -070039 - avoid_empty_else
Dan Rubel57843852016-09-09 13:37:56 -040040 # - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
Dan Rubel678da3a2016-09-12 16:32:08 -040041 - cancel_subscriptions
Dan Rubel7cf47ca2016-09-09 15:18:18 -040042 # - close_sinks # https://github.com/flutter/flutter/issues/5789
Ian Hickson94636bd2016-05-20 14:08:46 -070043 - control_flow_in_finally
Dan Rubel7cf47ca2016-09-09 15:18:18 -040044 - empty_statements
Ian Hickson94636bd2016-05-20 14:08:46 -070045 - hash_and_equals
Dan Rubel7cf47ca2016-09-09 15:18:18 -040046 # - invariant_booleans # https://github.com/flutter/flutter/issues/5790
Ian Hickson94636bd2016-05-20 14:08:46 -070047 # - iterable_contains_unrelated_type
Dan Rubel7cf47ca2016-09-09 15:18:18 -040048 - list_remove_unrelated_type
49 # - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
Ian Hickson94636bd2016-05-20 14:08:46 -070050 - test_types_in_equals
51 - throw_in_finally
52 - unrelated_type_equality_checks
Dan Rubel7cf47ca2016-09-09 15:18:18 -040053 - valid_regexps
Ian Hickson94636bd2016-05-20 14:08:46 -070054
Dan Rubel57843852016-09-09 13:37:56 -040055 # === style rules ===
krisgiesing07b5f832016-05-04 10:15:15 -070056 - always_declare_return_types
57 - always_specify_types
58 - annotate_overrides
59 - avoid_as
60 - avoid_init_to_null
Ian Hickson94636bd2016-05-20 14:08:46 -070061 - avoid_return_types_on_setters
62 - await_only_futures
krisgiesing07b5f832016-05-04 10:15:15 -070063 - camel_case_types
Dan Rubel57843852016-09-09 13:37:56 -040064 # - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
Ian Hickson94636bd2016-05-20 14:08:46 -070065 - control_flow_in_finally
krisgiesing07b5f832016-05-04 10:15:15 -070066 - empty_constructor_bodies
Ian Hickson94636bd2016-05-20 14:08:46 -070067 - implementation_imports
krisgiesing07b5f832016-05-04 10:15:15 -070068 - library_names
69 - library_prefixes
70 - non_constant_identifier_names
Ian Hickson94636bd2016-05-20 14:08:46 -070071 - one_member_abstracts
Dan Rubel7cf47ca2016-09-09 15:18:18 -040072 # - only_throw_errors # https://github.com/flutter/flutter/issues/5792
Dan Rubel57843852016-09-09 13:37:56 -040073 # - overridden_fields
krisgiesing07b5f832016-05-04 10:15:15 -070074 - package_api_docs
krisgiesing07b5f832016-05-04 10:15:15 -070075 - package_prefixed_library_names
76 - prefer_is_not_empty
Ian Hickson94636bd2016-05-20 14:08:46 -070077 # - public_member_api_docs
krisgiesing07b5f832016-05-04 10:15:15 -070078 - slash_for_doc_comments
79 - sort_constructors_first
80 - sort_unnamed_constructors_first
81 - super_goes_last
Ian Hickson94636bd2016-05-20 14:08:46 -070082 # - type_annotate_public_apis # subset of always_specify_types
krisgiesing07b5f832016-05-04 10:15:15 -070083 - type_init_formals
Dan Rubel7cf47ca2016-09-09 15:18:18 -040084 # - unawaited_futures # https://github.com/flutter/flutter/issues/5793
krisgiesing07b5f832016-05-04 10:15:15 -070085 - unnecessary_brace_in_string_interp
86 - unnecessary_getters_setters
Ian Hickson94636bd2016-05-20 14:08:46 -070087
Dan Rubel57843852016-09-09 13:37:56 -040088 # === pub rules ===
Ian Hickson94636bd2016-05-20 14:08:46 -070089 - package_names