krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 1 | # Specify analysis options. |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 2 | # |
| 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 Rubel | 3ed3390 | 2016-09-07 22:41:59 -0400 | [diff] [blame] | 10 | # 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. |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 14 | |
| 15 | analyzer: |
| 16 | language: |
| 17 | enableStrictCallChecks: true |
| 18 | enableSuperMixins: true |
| 19 | strong-mode: true |
| 20 | errors: |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 21 | # allow overriding fields (if they use super, ideally...) |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 22 | strong_mode_invalid_field_override: ignore |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 23 | # allow type narrowing |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 24 | strong_mode_invalid_method_override: ignore |
| 25 | strong_mode_static_type_error: ignore |
| 26 | strong_mode_down_cast_composite: ignore |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 27 | # allow having TODOs in the code |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 28 | todo: ignore |
Devon Carew | 207451f | 2016-08-18 19:11:39 -0700 | [diff] [blame] | 29 | exclude: |
| 30 | - 'bin/**' |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 31 | |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 32 | linter: |
| 33 | rules: |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 34 | # 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 Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 37 | |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 38 | # === error rules === |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 39 | - avoid_empty_else |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 40 | # - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153 |
Dan Rubel | 678da3a | 2016-09-12 16:32:08 -0400 | [diff] [blame^] | 41 | - cancel_subscriptions |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 42 | # - close_sinks # https://github.com/flutter/flutter/issues/5789 |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 43 | - control_flow_in_finally |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 44 | - empty_statements |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 45 | - hash_and_equals |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 46 | # - invariant_booleans # https://github.com/flutter/flutter/issues/5790 |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 47 | # - iterable_contains_unrelated_type |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 48 | - list_remove_unrelated_type |
| 49 | # - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791 |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 50 | - test_types_in_equals |
| 51 | - throw_in_finally |
| 52 | - unrelated_type_equality_checks |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 53 | - valid_regexps |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 54 | |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 55 | # === style rules === |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 56 | - always_declare_return_types |
| 57 | - always_specify_types |
| 58 | - annotate_overrides |
| 59 | - avoid_as |
| 60 | - avoid_init_to_null |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 61 | - avoid_return_types_on_setters |
| 62 | - await_only_futures |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 63 | - camel_case_types |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 64 | # - constant_identifier_names # https://github.com/dart-lang/linter/issues/204 |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 65 | - control_flow_in_finally |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 66 | - empty_constructor_bodies |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 67 | - implementation_imports |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 68 | - library_names |
| 69 | - library_prefixes |
| 70 | - non_constant_identifier_names |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 71 | - one_member_abstracts |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 72 | # - only_throw_errors # https://github.com/flutter/flutter/issues/5792 |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 73 | # - overridden_fields |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 74 | - package_api_docs |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 75 | - package_prefixed_library_names |
| 76 | - prefer_is_not_empty |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 77 | # - public_member_api_docs |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 78 | - slash_for_doc_comments |
| 79 | - sort_constructors_first |
| 80 | - sort_unnamed_constructors_first |
| 81 | - super_goes_last |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 82 | # - type_annotate_public_apis # subset of always_specify_types |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 83 | - type_init_formals |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 84 | # - unawaited_futures # https://github.com/flutter/flutter/issues/5793 |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 85 | - unnecessary_brace_in_string_interp |
| 86 | - unnecessary_getters_setters |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 87 | |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 88 | # === pub rules === |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 89 | - package_names |