2016-03-10 21:47:20 +00:00
|
|
|
# Specify analysis options.
|
|
|
|
#
|
2016-09-08 22:14:29 +00:00
|
|
|
# Until there are meta linter rules, each desired lint must be explicitly enabled.
|
|
|
|
# See: https://github.com/dart-lang/linter/issues/288
|
|
|
|
#
|
2016-03-10 21:47:20 +00:00
|
|
|
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
|
2016-09-08 22:14:29 +00:00
|
|
|
# See the configuration guide for more
|
|
|
|
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
|
2016-05-20 21:08:46 +00:00
|
|
|
#
|
2016-09-09 17:37:56 +00:00
|
|
|
# This file contains the analysis options used by "flutter analyze"
|
2016-09-08 22:14:29 +00:00
|
|
|
# when analyzing code outside the flutter repository.
|
2016-09-09 17:37:56 +00:00
|
|
|
# It isn't named '.analysis_options' because otherwise editors like Atom
|
2016-09-08 22:14:29 +00:00
|
|
|
# would use it when analyzing the flutter tool itself.
|
2016-05-20 21:08:46 +00:00
|
|
|
#
|
|
|
|
# When editing, make sure you keep /.analysis_options consistent.
|
2016-04-04 19:18:13 +00:00
|
|
|
|
2016-03-10 21:47:20 +00:00
|
|
|
analyzer:
|
2016-03-11 22:52:07 +00:00
|
|
|
language:
|
2016-04-11 21:05:44 +00:00
|
|
|
enableStrictCallChecks: true
|
2016-03-11 22:52:07 +00:00
|
|
|
enableSuperMixins: true
|
2016-03-11 23:18:30 +00:00
|
|
|
strong-mode: true
|
2016-03-10 21:47:20 +00:00
|
|
|
errors:
|
2016-09-08 22:14:29 +00:00
|
|
|
# allow overriding fields (if they use super, ideally...)
|
2016-03-10 21:47:20 +00:00
|
|
|
strong_mode_invalid_field_override: ignore
|
2016-09-08 22:14:29 +00:00
|
|
|
# allow type narrowing
|
2016-03-11 23:18:30 +00:00
|
|
|
strong_mode_down_cast_composite: ignore
|
2016-09-08 22:14:29 +00:00
|
|
|
# allow having TODOs in the code
|
2016-03-10 21:47:20 +00:00
|
|
|
todo: ignore
|
2016-05-20 21:08:46 +00:00
|
|
|
|
2016-03-10 21:47:20 +00:00
|
|
|
linter:
|
|
|
|
rules:
|
2016-09-08 22:14:29 +00:00
|
|
|
# these rules are documented on and in the same order as
|
|
|
|
# the Dart Lint rules page to make maintenance easier
|
|
|
|
# http://dart-lang.github.io/linter/lints/
|
2016-05-20 21:08:46 +00:00
|
|
|
|
2016-09-08 22:14:29 +00:00
|
|
|
# === error rules ===
|
2016-03-09 23:20:29 +00:00
|
|
|
- avoid_empty_else
|
2016-09-08 22:14:29 +00:00
|
|
|
- cancel_subscriptions
|
|
|
|
- close_sinks
|
2016-05-20 21:08:46 +00:00
|
|
|
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
|
|
|
|
- control_flow_in_finally
|
2016-07-29 05:50:40 +00:00
|
|
|
- empty_statements
|
2016-05-20 21:08:46 +00:00
|
|
|
- hash_and_equals
|
2016-09-08 22:14:29 +00:00
|
|
|
# - invariant_booleans
|
|
|
|
# - iterable_contains_unrelated_type
|
2016-09-09 17:37:56 +00:00
|
|
|
# - list_remove_unrelated_type
|
|
|
|
# - literal_only_boolean_expressions
|
2016-05-20 21:08:46 +00:00
|
|
|
- test_types_in_equals
|
|
|
|
- throw_in_finally
|
|
|
|
- unrelated_type_equality_checks
|
2016-09-08 22:14:29 +00:00
|
|
|
- valid_regexps
|
2016-05-20 21:08:46 +00:00
|
|
|
|
2016-09-08 22:14:29 +00:00
|
|
|
# === style rules ===
|
|
|
|
# - always_declare_return_types
|
|
|
|
# - always_specify_types
|
|
|
|
# - annotate_overrides
|
|
|
|
# - avoid_as
|
2016-03-11 07:15:31 +00:00
|
|
|
- avoid_init_to_null
|
2016-05-12 18:45:30 +00:00
|
|
|
- avoid_return_types_on_setters
|
2016-05-20 21:08:46 +00:00
|
|
|
- await_only_futures
|
2016-03-10 21:47:20 +00:00
|
|
|
- camel_case_types
|
2016-05-20 21:08:46 +00:00
|
|
|
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
|
2016-03-10 21:47:20 +00:00
|
|
|
- empty_constructor_bodies
|
2016-05-17 18:02:10 +00:00
|
|
|
- implementation_imports
|
2016-03-11 07:15:31 +00:00
|
|
|
- library_names
|
2016-03-10 21:47:20 +00:00
|
|
|
- library_prefixes
|
|
|
|
- non_constant_identifier_names
|
2016-09-08 22:14:29 +00:00
|
|
|
# - one_member_abstracts
|
|
|
|
# - only_throw_errors
|
2016-09-09 17:37:56 +00:00
|
|
|
# - overridden_fields
|
2016-03-11 07:15:31 +00:00
|
|
|
- package_api_docs
|
|
|
|
- package_prefixed_library_names
|
|
|
|
- prefer_is_not_empty
|
2016-09-08 22:14:29 +00:00
|
|
|
# - public_member_api_docs
|
2016-03-10 21:47:20 +00:00
|
|
|
- slash_for_doc_comments
|
2016-09-08 22:14:29 +00:00
|
|
|
# - sort_constructors_first
|
|
|
|
# - sort_unnamed_constructors_first
|
2016-03-10 21:47:20 +00:00
|
|
|
- super_goes_last
|
2016-05-20 21:08:46 +00:00
|
|
|
# - type_annotate_public_apis # subset of always_specify_types
|
2016-03-10 21:47:20 +00:00
|
|
|
- type_init_formals
|
2016-09-08 22:14:29 +00:00
|
|
|
# - unawaited_futures
|
2016-03-10 21:47:20 +00:00
|
|
|
- unnecessary_brace_in_string_interp
|
2016-03-11 07:15:31 +00:00
|
|
|
- unnecessary_getters_setters
|
2016-05-20 21:08:46 +00:00
|
|
|
|
2016-09-08 22:14:29 +00:00
|
|
|
# === pub rules ===
|
2016-05-20 21:08:46 +00:00
|
|
|
- package_names
|