generated from xmartlabs/flutter-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
analysis_options.yaml
140 lines (134 loc) · 4.2 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
rules:
- always_declare_return_types
- always_put_required_named_parameters_first
- always_use_package_imports
- annotate_overrides
- avoid_bool_literals_in_conditional_expressions
- avoid_catching_errors
- avoid_empty_else
- avoid_multiple_declarations_per_line
- avoid_null_checks_in_equality_operators
- avoid_print
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null
- avoid_returning_null_for_future
- avoid_returning_null_for_void
- avoid_returning_this
- avoid_shadowing_type_parameters
- avoid_single_cascade_in_expression_statements
- avoid_type_to_string
- avoid_types_as_parameter_names
- avoid_unnecessary_containers
- avoid_void_async
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- cascade_invocations
- cast_nullable_to_non_nullable
- close_sinks
- constant_identifier_names
- curly_braces_in_flow_control_structures
- empty_constructor_bodies
- empty_statements
- eol_at_end_of_file
- exhaustive_cases
- file_names
- hash_and_equals
- library_names
- lines_longer_than_80_chars
- collection_methods_unrelated_type
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_default_cases
- no_duplicate_case_values
- no_leading_underscores_for_local_identifiers
- no_runtimeType_toString
- non_constant_identifier_names
- only_throw_errors
- prefer_adjacent_string_concatenation
- prefer_asserts_with_message
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_contains
- prefer_expression_function_bodies
- prefer_final_in_for_each
- prefer_final_locals
- prefer_if_null_operators
- prefer_initializing_formals
- prefer_is_empty
- prefer_is_not_empty
- prefer_is_not_operator
- prefer_iterable_whereType
- prefer_void_to_null
- recursive_getters
- require_trailing_commas
- slash_for_doc_comments
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_late
- unnecessary_new
- unnecessary_nullable_for_final_variable_declarations
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_raw_strings
- unnecessary_statements
- unnecessary_string_interpolations
- unnecessary_this
- unrelated_type_equality_checks
- use_build_context_synchronously
- use_if_null_to_convert_nulls_to_bools
- use_key_in_widget_constructors
- valid_regexps
dart_code_metrics:
anti-patterns:
- long-method
- long-parameter-list
metrics:
cyclomatic-complexity: 20
maximum-nesting-level: 5
number-of-parameters: 4
source-lines-of-code: 50
metrics-exclude:
- test/**
rules:
- avoid-nested-conditional-expressions
- avoid-passing-async-when-sync-expected
- avoid-redundant-async
- no-boolean-literal-compare
- no-empty-block
- no-equal-then-else
- no-object-declaration
- prefer-conditional-expressions
- prefer-first
- prefer-immediate-return
- prefer-last
- prefer-moving-to-variable:
allowed-duplicated-chains: 3
- prefer-trailing-comma
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
exclude:
- '**/*.freezed.dart'
- '**/*.g.dart'
- '**/*.gen.dart'
- '**/*.gr.dart'
- 'lib/generated_plugin_registrant.dart'
- 'lib/gen/assets.gen.dart'
- 'lib/firebase_options_*.dart'
errors:
invalid_annotation_target: ignore