-
Notifications
You must be signed in to change notification settings - Fork 2
/
analysis_options.yaml
484 lines (394 loc) · 13.5 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
## analysis_options.yaml docs: https://www.dartlang.org/guides/language/analysis-options
analyzer:
# Strong mode is required. Applies to the current project.
strong-mode:
# When compiling to JS, both implicit options apply to the current
# project and all dependencies. They are useful to find possible
# Type fixes or areas for explicit typing.
implicit-casts: true
implicit-dynamic: true
exclude:
- lib/src/model/transaction/buffer/**
#
## ALL lint rules are included. Unused lints should be commented
## out with a reason. An up to date list of all options is here
## http://dart-lang.github.io/linter/lints/options/options.html
## Descriptions of each rule is here http://dart-lang.github.io/linter/lints/
##
## To ignore a lint rule on a case by case basic in code just add a comment
## above it or at the end of the line like: // ignore: <linter rule>
## example: // ignore: invalid_assignment, const_initialized_with_non_constant_value
##
## More info about configuring analysis_options.yaml files
## https://www.dartlang.org/guides/language/analysis-options#excluding-lines-within-a-file
linter:
rules:
# Put @required named parameters first.
# recommendation: recommended
# 0 issues
- always_put_required_named_parameters_first
# Use @required.
# recommendation: recommended
# 0 issues
- always_require_non_null_named_parameters
# Specify type annotations.
# recommendation: recommended
# FIXME: 83 lint(s)
# - always_specifytypes
# Annotate overridden members.
# recommendation: required
# 0 issues
- annotate_overrides
# Avoid annotating with dynamic when not required.
# recommendation: optional
# 0 issues
- avoid_annotating_with_dynamic
# Avoid bool literals in conditional expressions.
# recommendation: optional
# 0 issues
- avoid_bool_literals_in_conditional_expressions
# Avoid catches without on clauses.
# recommendation: optional
# 0 issues
- avoid_catches_without_on_clauses
# Don't explicitly on Exception catch Error or types that implement it.
# recommendation: optional
# 0 issues
- avoid_catching_errors
# Avoid defining a class that contains only static members.
# recommendation: recommended
# 0 issues
- avoid_classes_with_only_static_members: false
# Avoid empty else statements.
# recommendation: required
# 0 issues
- avoid_empty_else
# Avoid using `forEach` with a function literal.
# recommendation: recommended
# reason: Use for (x in y) or forEach(someFunc) instead
# 0 issues
- avoid_function_literals_in_foreach_calls
# Don't explicitly initialize variables to null.
# recommendation: recommended
# 0 issues
- avoid_init_to_null
# Don't check for null in custom == operators.
# recommendation: recommended
# 0 issues
- avoid_null_checks_in_equality_operators
# Avoid positional boolean parameters.
# recommendation: recommended
# 0 issues
- avoid_positional_boolean_parameters
# Avoid relative imports for files in `lib/`.
# recommendation: recommended
# reason: JS compilation will be faster without relative imports. Use package imports.
# 0 issues
- avoid_relative_lib_imports
# Don't rename parameters of overridden methods.
# recommendation: optional
# 0 issues
- avoid_renaming_method_parameters
# Avoid returning null from members whose return type is bool, double, int, or num.
# recommendation: optional
# 0 issues
- avoid_returning_null
# Avoid setters without getters.
# recommendation: recommended
# 0 issues
- avoid_setters_without_getters
# Avoid single cascade in expression statements.
# recommendation: optional
# FIXME: 1 lint(s)
- avoid_single_cascade_in_expression_statements
# Avoid slow async `dart:io` methods.
# recommendation: recommended
# 0 issues
- avoid_slow_async_io
# Avoid defining unused paramters in constructors.
# recommendation: recommended
# 0 issues
- avoid_unused_constructor_parameters
# Await only futures.
# recommendation: required
# 0 issues
- await_only_futures
# Cancel instances of dart.async.StreamSubscription.
# recommendation: required
# 0 issues
- cancel_subscriptions
# Close instances of `dart.core.Sink`.
# recommendation: required
# 0 issues
- close_sinks
# Only reference in scope identifiers in doc comments.
# recommendation: optional
# 0 issues
- comment_references
# Prefer using lowerCamelCase for constant names.
# recommendation: optional
# 0 issues
- constant_identifier_names
# Avoid control flow in finally blocks.
# recommendation: required
# 0 issues
- control_flow_in_finally
# Adhere to Effective Dart Guide directives sorting conventions.
# recommendation: required
# 0 issues
- directives_ordering
# Avoid empty on Exception catch blocks.
# recommendation: recommended
# 0 issues
- empty_catches
# Use `;` instead of `{}` for empty constructor bodies.
# recommendation: recommended
# 0 issues
- empty_constructor_bodies
# Avoid empty statements.
# recommendation: required
# 0 issues
- empty_statements
# Always override `hashCode` if overriding `==`.
# recommendation: required
# 0 issues
- hash_and_equals
# Don't import implementation files from another package.
# recommendation: required
# 0 issues
- implementation_imports
# Conditions should not unconditionally evaluate to `true` or to `false`.
# recommendation: required
# 0 issues
- invariant_booleans
# Join return statement with assignment when possible.
# recommendation: optional
# 0 issues
- join_return_with_assignment
# Name libraries and source files using `lowercase_with_underscores`.
# recommendation: recommended
# 0 issues
- library_names
# Use `lowercase_with_underscores` when specifying a library prefix.
# recommendation: recommended
# 0 issues
- library_prefixes
# Boolean expression composed only with literals.
# recommendation: required
# 0 issues
- literal_only_boolean_expressions
# Don't use adjacent strings in list.
# recommendation: required
# 0 issues
- no_adjacent_strings_in_list
# Don't use more than one case with same value.
# recommendation: required
# 0 issues
- no_duplicate_case_values
# Name non-constant identifiers using lowerCamelCase.
# recommendation: recommended
# 0 issues
- non_constant_identifier_names: false
# Omit type annotations for local variables.
# recommendation: avoid
# reason: Conflicts with always_specifytypes. Recommend commenting this one out.
# 0 issues
# - omit_local_variabletypes
# Avoid defining a one-member abstract class when a simple function will do.
# recommendation: optional
# 0 issues
- one_member_abstracts
# Only throw instances of classes extending either Exception or Error.
# recommendation: required
# 0 issues
- only_throw_errors
# Don't override fields.
# recommendation: optional
# 0 issues
- overridden_fields
# Provide doc comments for all public APIs.
# recommendation: optional
# 0 issues
- package_api_docs
# Use `lowercase_with_underscores` for package names.
# recommendation: recommended
# 0 issues
- package_names
# Prefix library names with the package name and a dot-separated path.
# recommendation: recommended
# 0 issues
- package_prefixed_library_names
# Don't reassign references to parameters of functions or methods.
# recommendation: optional
# 0 issues
- parameter_assignments: false
# Use adjacent strings to concatenate string literals.
# recommendation: optional
# 0 issues
- prefer_adjacent_string_concatenation
# Prefer putting asserts in initializer list.
# recommendation: optional
# 0 issues
- prefer_asserts_in_initializer_lists
# Use collection literals when possible.
# recommendation: optional
# 0 issues
- prefer_collection_literals
# Prefer using `??=` over testing for null.
# recommendation: optional
# 0 issues
- prefer_conditional_assignment
# Prefer const with constant constructors.
# recommendation: optional
# 0 issues
- prefer_const_constructors
# Prefer declare const constructors on `@immutable` classes.
# recommendation: optional
# 0 issues
- prefer_const_constructors_in_immutables
# Prefer const over final for declarations.
# recommendation: recommended
# 0 issues
- prefer_const_declarations
# Prefer const literals as parameters of constructors on @immutable classes.
# recommendation: optional
# 0 issues
- prefer_const_literals_to_create_immutables
# Use contains for `List` and `String` instances.
# recommendation: optional
# 0 issues
- prefer_contains
# Prefer equal for default values.
# recommendation: optional
# 0 issues
- prefer_equal_for_default_values
# Use => for short members whose body is a single return statement.
# recommendation: optional
# 0 issues
- prefer_expression_function_bodies
# Private field could be final.
# recommendation: optional
# 0 issues
- prefer_final_fields
# Prefer final for variable declaration if reference is not reassigned.
# recommendation: optional
# reason: Generates a lot of lint since people use var a lot for local variables.
# 0 issues
- prefer_final_locals: false
# Use `forEach` to only apply a function to all the elements.
# recommendation: optional
# 0 issues
- prefer_foreach
# Use a function declaration to bind a function to a name.
# recommendation: optional
# 0 issues
- prefer_function_declarations_over_variables
# Use initializing formals when possible.
# recommendation: recommended
# 0 issues
- prefer_initializing_formals
# Use `isEmpty` for Iterables and Maps.
# recommendation: optional
# 0 issues
- prefer_is_empty
# Use `isNotEmpty` for Iterables and Maps.
# recommendation: optional
# 0 issues
- prefer_is_not_empty
# Prefer single quotes where they won't require escape sequences.
# recommendation: optional
# 0 issues
- prefer_single_quotes
# Prefer typing uninitialized variables and fields.
# recommendation: optional
# 0 issues
- prefer_typing_uninitialized_variables
# Document all public members.
# recommendation: optional
# reason: Can get annoying for React component lifecycle methods, constructors.
# FIXME: 10 lint(s)
# public_member_api_docs
# Property getter recursively returns itself.
# recommendation: optional
# 0 issues
- recursive_getters
# Prefer using /// for doc comments.
# recommendation: recommended
# 0 issues
- slash_for_doc_comments
# Sort constructor declarations before method declarations.
# recommendation: optional
# 0 issues
- sort_constructors_first: false
# Sort unnamed constructor declarations first.
# recommendation: optional
# 0 issues
- sort_unnamed_constructors_first: false
# Avoid `throw` in finally block.
# recommendation: required
# 0 issues
- throw_in_finally
# Don't type annotate initializing formals.
# recommendation: optional
# 0 issues
- type_init_formals
# Await future-returning functions inside async function bodies.
# recommendation: recommended
# 0 issues
- unawaited_futures
# Avoid using braces in interpolation when not needed.
# recommendation: optional
# 0 issues
- unnecessary_brace_in_string_interps: false
# Avoid wrapping fields in getters and setters just to be 'safe'.
# recommendation: optional
# 0 issues
- unnecessary_getters_setters
# Don't create a lambda when a tear-off will do.
# recommendation: optional
# 0 issues
- unnecessary_lambdas
# Avoid null in null-aware assignment.
# recommendation: optional
# 0 issues
- unnecessary_null_aware_assignments
# Avoid using `null` in `if null` operators.
# recommendation: optional
# 0 issues
- unnecessary_null_in_if_null_operators
# Don't override a method to do a super method invocation with the same parameters.
# recommendation: optional
# 0 issues
- unnecessary_overrides
# Unnecessary parenthesis can be removed.
# recommendation: optional
# 0 issues
- unnecessary_parenthesis
# Avoid using unnecessary statements.
# recommendation: required
# 0 issues
- unnecessary_statements
# Don't access members with `this` unless avoiding shadowing.
# recommendation: recommended
# 0 issues
- unnecessary_this
# Use rethrow to rethrow a caught exception.
# recommendation: optional
# 0 issues
- use_rethrow_when_possible
# Use a setter for operations that conceptually change a property.
# recommendation: optional
# 0 issues
- use_setters_to_change_properties
# Use string buffer to compose strings.
# recommendation: optional
# 0 issues
- use_string_buffers
# Start the name of the method with to/_to or as/_as if applicable.
# recommendation: optional
# 0 issues
- use_to_and_as_if_applicable
# Use valid regular expression syntax.
# recommendation: required
# 0 issues
- valid_regexps