2016-05-04 17:15:15 +00:00
|
|
|
# Specify analysis options.
|
2016-09-09 17:37:56 +00:00
|
|
|
#
|
|
|
|
# Until there are meta linter rules, each desired lint must be explicitly enabled.
|
|
|
|
# See: https://github.com/dart-lang/linter/issues/288
|
|
|
|
#
|
|
|
|
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
|
|
|
|
# See the configuration guide for more
|
|
|
|
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
|
|
|
|
#
|
2017-02-13 21:39:35 +00:00
|
|
|
# There are three similar analysis options files in the flutter repo:
|
|
|
|
# - .analysis_options (this file)
|
|
|
|
# - .analysis_options_repo
|
|
|
|
# - packages/flutter/lib/analysis_options_user.yaml
|
|
|
|
#
|
2016-09-08 02:41:59 +00:00
|
|
|
# This file contains the analysis options used by Flutter editors, such as Atom.
|
2017-02-13 21:39:35 +00:00
|
|
|
# It is very similar to the .analysis_options_repo file in this same directory;
|
2016-09-08 02:41:59 +00:00
|
|
|
# the only difference (currently) is the public_member_api_docs option,
|
|
|
|
# which triggers too many messages to be used in editors.
|
2016-05-04 17:15:15 +00:00
|
|
|
|
|
|
|
analyzer:
|
|
|
|
language:
|
|
|
|
enableStrictCallChecks: true
|
|
|
|
enableSuperMixins: true
|
2017-01-23 09:04:31 +00:00
|
|
|
strong-mode:
|
|
|
|
implicit-dynamic: false
|
2016-05-04 17:15:15 +00:00
|
|
|
errors:
|
2017-02-13 22:56:56 +00:00
|
|
|
# treat missing required parameters as a warning (not a hint)
|
|
|
|
missing_required_param: warning
|
2017-03-16 21:28:18 +00:00
|
|
|
# treat missing returns as a warning (not a hint)
|
|
|
|
missing_return: warning
|
2016-09-09 17:37:56 +00:00
|
|
|
# allow overriding fields (if they use super, ideally...)
|
2016-05-04 17:15:15 +00:00
|
|
|
strong_mode_invalid_field_override: ignore
|
2016-09-09 17:37:56 +00:00
|
|
|
# allow having TODOs in the code
|
2016-05-04 17:15:15 +00:00
|
|
|
todo: ignore
|
2016-08-19 02:11:39 +00:00
|
|
|
exclude:
|
2016-11-07 22:47:53 +00:00
|
|
|
- 'bin/cache/**'
|
2017-01-23 00:43:24 +00:00
|
|
|
# the following two are relative to the stocks example and the flutter package respectively
|
|
|
|
# see https://github.com/dart-lang/sdk/issues/28463
|
|
|
|
- 'lib/i18n/stock_messages_*.dart'
|
|
|
|
- 'lib/src/http/**'
|
2016-05-20 21:08:46 +00:00
|
|
|
|
2016-05-04 17:15:15 +00:00
|
|
|
linter:
|
|
|
|
rules:
|
2016-09-09 17:37:56 +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-09 17:37:56 +00:00
|
|
|
# === error rules ===
|
2016-05-04 17:15:15 +00:00
|
|
|
- avoid_empty_else
|
2017-02-15 22:41:54 +00:00
|
|
|
- avoid_slow_async_io
|
2016-09-09 17:37:56 +00:00
|
|
|
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
|
2016-09-12 20:32:08 +00:00
|
|
|
- cancel_subscriptions
|
2016-09-09 19:18:18 +00:00
|
|
|
# - close_sinks # https://github.com/flutter/flutter/issues/5789
|
2016-05-20 21:08:46 +00:00
|
|
|
- control_flow_in_finally
|
2016-09-09 19:18:18 +00:00
|
|
|
- empty_statements
|
2016-05-20 21:08:46 +00:00
|
|
|
- hash_and_equals
|
2016-09-09 19:18:18 +00:00
|
|
|
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
|
2016-05-20 21:08:46 +00:00
|
|
|
# - iterable_contains_unrelated_type
|
2016-09-09 19:18:18 +00:00
|
|
|
- list_remove_unrelated_type
|
|
|
|
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
|
2016-05-20 21:08:46 +00:00
|
|
|
- test_types_in_equals
|
|
|
|
- throw_in_finally
|
|
|
|
- unrelated_type_equality_checks
|
2016-09-09 19:18:18 +00:00
|
|
|
- valid_regexps
|
2016-05-20 21:08:46 +00:00
|
|
|
|
2016-09-09 17:37:56 +00:00
|
|
|
# === style rules ===
|
2016-05-04 17:15:15 +00:00
|
|
|
- always_declare_return_types
|
|
|
|
- always_specify_types
|
|
|
|
- annotate_overrides
|
|
|
|
- avoid_as
|
|
|
|
- avoid_init_to_null
|
2016-05-20 21:08:46 +00:00
|
|
|
- avoid_return_types_on_setters
|
|
|
|
- await_only_futures
|
2016-05-04 17:15:15 +00:00
|
|
|
- camel_case_types
|
2016-09-09 17:37:56 +00:00
|
|
|
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
|
2016-05-20 21:08:46 +00:00
|
|
|
- control_flow_in_finally
|
2016-05-04 17:15:15 +00:00
|
|
|
- empty_constructor_bodies
|
2016-05-20 21:08:46 +00:00
|
|
|
- implementation_imports
|
2016-05-04 17:15:15 +00:00
|
|
|
- library_names
|
|
|
|
- library_prefixes
|
|
|
|
- non_constant_identifier_names
|
2016-05-20 21:08:46 +00:00
|
|
|
- one_member_abstracts
|
2016-09-09 19:18:18 +00:00
|
|
|
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
|
2016-09-09 17:37:56 +00:00
|
|
|
# - overridden_fields
|
2016-05-04 17:15:15 +00:00
|
|
|
- package_api_docs
|
|
|
|
- package_prefixed_library_names
|
2017-03-04 02:47:00 +00:00
|
|
|
- prefer_final_locals
|
2016-05-04 17:15:15 +00:00
|
|
|
- prefer_is_not_empty
|
2016-05-20 21:08:46 +00:00
|
|
|
# - public_member_api_docs
|
2016-05-04 17:15:15 +00:00
|
|
|
- slash_for_doc_comments
|
|
|
|
- sort_constructors_first
|
|
|
|
- sort_unnamed_constructors_first
|
|
|
|
- super_goes_last
|
2016-05-20 21:08:46 +00:00
|
|
|
# - type_annotate_public_apis # subset of always_specify_types
|
2016-05-04 17:15:15 +00:00
|
|
|
- type_init_formals
|
|
|
|
- unnecessary_brace_in_string_interp
|
|
|
|
- unnecessary_getters_setters
|
2016-05-20 21:08:46 +00:00
|
|
|
|
2016-09-09 17:37:56 +00:00
|
|
|
# === pub rules ===
|
2016-05-20 21:08:46 +00:00
|
|
|
- package_names
|