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 |
Ian Hickson | 63aa139 | 2017-01-23 01:04:31 -0800 | [diff] [blame^] | 19 | strong-mode: |
| 20 | implicit-dynamic: false |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 21 | errors: |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 22 | # allow overriding fields (if they use super, ideally...) |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 23 | strong_mode_invalid_field_override: ignore |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 24 | # allow type narrowing |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 25 | strong_mode_down_cast_composite: ignore |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 26 | # allow having TODOs in the code |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 27 | todo: ignore |
Devon Carew | 207451f | 2016-08-18 19:11:39 -0700 | [diff] [blame] | 28 | exclude: |
Devon Carew | f1b3523 | 2016-11-07 14:47:53 -0800 | [diff] [blame] | 29 | - 'bin/cache/**' |
Ian Hickson | cbda208 | 2017-01-22 16:43:24 -0800 | [diff] [blame] | 30 | # the following two are relative to the stocks example and the flutter package respectively |
| 31 | # see https://github.com/dart-lang/sdk/issues/28463 |
| 32 | - 'lib/i18n/stock_messages_*.dart' |
| 33 | - 'lib/src/http/**' |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 34 | |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 35 | linter: |
| 36 | rules: |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 37 | # these rules are documented on and in the same order as |
| 38 | # the Dart Lint rules page to make maintenance easier |
| 39 | # http://dart-lang.github.io/linter/lints/ |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 40 | |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 41 | # === error rules === |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 42 | - avoid_empty_else |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 43 | # - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153 |
Dan Rubel | 678da3a | 2016-09-12 16:32:08 -0400 | [diff] [blame] | 44 | - cancel_subscriptions |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 45 | # - close_sinks # https://github.com/flutter/flutter/issues/5789 |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 46 | - control_flow_in_finally |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 47 | - empty_statements |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 48 | - hash_and_equals |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 49 | # - invariant_booleans # https://github.com/flutter/flutter/issues/5790 |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 50 | # - iterable_contains_unrelated_type |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 51 | - list_remove_unrelated_type |
| 52 | # - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791 |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 53 | - test_types_in_equals |
| 54 | - throw_in_finally |
| 55 | - unrelated_type_equality_checks |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 56 | - valid_regexps |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 57 | |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 58 | # === style rules === |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 59 | - always_declare_return_types |
| 60 | - always_specify_types |
| 61 | - annotate_overrides |
| 62 | - avoid_as |
| 63 | - avoid_init_to_null |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 64 | - avoid_return_types_on_setters |
| 65 | - await_only_futures |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 66 | - camel_case_types |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 67 | # - constant_identifier_names # https://github.com/dart-lang/linter/issues/204 |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 68 | - control_flow_in_finally |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 69 | - empty_constructor_bodies |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 70 | - implementation_imports |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 71 | - library_names |
| 72 | - library_prefixes |
| 73 | - non_constant_identifier_names |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 74 | - one_member_abstracts |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 75 | # - only_throw_errors # https://github.com/flutter/flutter/issues/5792 |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 76 | # - overridden_fields |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 77 | - package_api_docs |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 78 | - package_prefixed_library_names |
| 79 | - prefer_is_not_empty |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 80 | # - public_member_api_docs |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 81 | - slash_for_doc_comments |
| 82 | - sort_constructors_first |
| 83 | - sort_unnamed_constructors_first |
| 84 | - super_goes_last |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 85 | # - type_annotate_public_apis # subset of always_specify_types |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 86 | - type_init_formals |
Dan Rubel | 7cf47ca | 2016-09-09 15:18:18 -0400 | [diff] [blame] | 87 | # - unawaited_futures # https://github.com/flutter/flutter/issues/5793 |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 88 | - unnecessary_brace_in_string_interp |
| 89 | - unnecessary_getters_setters |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 90 | |
Dan Rubel | 5784385 | 2016-09-09 13:37:56 -0400 | [diff] [blame] | 91 | # === pub rules === |
Ian Hickson | 94636bd | 2016-05-20 14:08:46 -0700 | [diff] [blame] | 92 | - package_names |