-
Notifications
You must be signed in to change notification settings - Fork 19
/
analysis_options.yaml
102 lines (100 loc) · 3.68 KB
/
analysis_options.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Specify analysis options.
#
# 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
#
# There are other similar analysis options files in the flutter repos,
# which should be kept in sync with this file:
#
# - analysis_options.yaml (this file)
# - packages/flutter/lib/analysis_options_user.yaml
# - https://github.com/flutter/plugins/blob/master/analysis_options.yaml
# - https://github.com/flutter/engine/blob/master/analysis_options.yaml
#
# This file contains the analysis options used by Flutter tools, such as IntelliJ,
# Android Studio, and the `flutter analyze` command.
analyzer:
strong-mode:
implicit-dynamic: false
errors:
# treat missing required parameters as a warning (not a hint)
missing_required_param: warning
# treat missing returns as a warning (not a hint)
missing_return: warning
# allow having TODOs in the code
todo: ignore
# Ignore analyzer hints for updating pubspecs when using Future or
# Stream and not importing dart:async
# Please see https://github.com/flutter/flutter/pull/24528 for details.
sdk_version_async_exported_from_core: ignore
exclude:
- "bin/cache/**"
# 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/**"
linter:
rules:
# https://github.com/dart-lang/linter/tree/master/example
#
# STYLE
- camel_case_types
- library_names
- file_names
- library_prefixes
- non_constant_identifier_names
- constant_identifier_names # prefer
- directives_ordering
- lines_longer_than_80_chars # avoid
- curly_braces_in_flow_control_structures
# DOCUMENTATION
- slash_for_doc_comments
- package_api_docs # prefer
# - public_member_api_docs # prefer
- comment_references
# USAGE
- avoid_relative_lib_imports # prefer
- prefer_const_constructors
- prefer_adjacent_string_concatenation
- prefer_interpolation_to_compose_strings # prefer
- unnecessary_brace_in_string_interps # avoid
- prefer_collection_literals
# - avoid_function_literals_in_foreach_calls # avoid
- prefer_iterable_whereType
- prefer_function_declarations_over_variables
# - unnecessary_lambdas
- prefer_equal_for_default_values
- avoid_init_to_null
- unnecessary_getters_setters
# - unnecessary_getters # prefer
#- prefer_expression_function_bodies # consider
- unnecessary_this
- prefer_initializing_formals
- type_init_formals
- empty_constructor_bodies
- unnecessary_new
- unnecessary_const
- avoid_catches_without_on_clauses # avoid
- use_rethrow_when_possible
# DESIGN
- use_to_and_as_if_applicable # prefer
- one_member_abstracts # avoid
- avoid_classes_with_only_static_members # avoid
- prefer_final_fields # prefer
- use_setters_to_change_properties
- avoid_setters_without_getters
# - avoid_returning_null # avoid
- avoid_returning_this # avoid
- prefer_typing_uninitialized_variables # prefer
- omit_local_variable_types # avoid
- avoid_return_types_on_setters
- prefer_generic_function_type_aliases
- avoid_private_typedef_functions
#- use_function_type_syntax_for_parameters # consider
#- avoid_positional_boolean_parameters # avoid
- hash_and_equals
# - avoid_null_checks_in_equality_operatorss # not yet tested