-
Notifications
You must be signed in to change notification settings - Fork 55
/
all_lint_rules.yaml
677 lines (452 loc) · 22.9 KB
/
all_lint_rules.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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
linter:
rules:
# [ errors/stable ] Avoid relative imports for files in `lib/`.
- always_use_package_imports
# [ errors/stable ] Avoid method calls or property accesses on a "dynamic" target.
- avoid_dynamic_calls
# [ errors/stable ] Avoid empty else statements.
- avoid_empty_else
# [ errors/stable ] Avoid `print` calls in production code.
- avoid_print
# [ errors/stable ] Avoid relative imports for files in `lib/`.
- avoid_relative_lib_imports
# [ errors/deprecated ] Avoid returning null for Future.
- avoid_returning_null_for_future
# [ errors/stable ] Avoid slow async `dart:io` methods.
- avoid_slow_async_io
# [ errors/stable ] Avoid <Type>.toString() in production code since results may be minified.
- avoid_type_to_string
# [ errors/stable ] Avoid types as parameter names.
- avoid_types_as_parameter_names
# [ errors/stable ] Avoid using web-only libraries outside Flutter web plugin packages.
- avoid_web_libraries_in_flutter
# [ errors/stable ] Cancel instances of dart.async.StreamSubscription.
- cancel_subscriptions
# [ errors/stable ] Close instances of `dart.core.Sink`.
- close_sinks
# [ errors/stable ] Invocation of various collection methods with arguments of unrelated types.
- collection_methods_unrelated_type
# [ errors/stable ] Only reference in scope identifiers in doc comments.
- comment_references
# [ errors/stable ] Avoid control flow in finally blocks.
- control_flow_in_finally
# [ errors/stable ] Avoid using deprecated elements from within the package in which they are declared.
- deprecated_member_use_from_same_package
# [ errors/stable ] DO reference all public properties in debug methods.
- diagnostic_describe_all_properties
# [ errors/stable ] Don't invoke asynchronous functions in non-async blocks.
- discarded_futures
# [ errors/stable ] Avoid empty statements.
- empty_statements
# [ errors/stable ] Always override `hashCode` if overriding `==`.
- hash_and_equals
# [ errors/experimental ] Don't implicitly reopen classes.
- implicit_reopen
# [ errors/experimental ] Use case expressions that are valid in Dart 3.0.
- invalid_case_patterns
# [ errors/removed ] Conditions should not unconditionally evaluate to `true` or to `false`.
# - invariant_booleans
# [ errors/stable ] Invocation of Iterable<E>.contains with references of unrelated types.
- iterable_contains_unrelated_type
# [ errors/stable ] Invocation of `remove` with references of unrelated types.
- list_remove_unrelated_type
# [ errors/stable ] Boolean expression composed only with literals.
- literal_only_boolean_expressions
# [ errors/stable ] Don't use adjacent strings in list.
- no_adjacent_strings_in_list
# [ errors/stable ] Don't use more than one case with same value.
- no_duplicate_case_values
# [ errors/stable ] Don't put any logic in createState.
- no_logic_in_create_state
# [ errors/stable ] Prefer relative imports for files in `lib/`.
- prefer_relative_imports
# [ errors/stable ] Don't use the Null type, unless you are positive that you don't want void.
- prefer_void_to_null
# [ errors/stable ] Test type arguments in operator ==(Object other).
- test_types_in_equals
# [ errors/stable ] Avoid `throw` in finally block.
- throw_in_finally
# [ errors/stable ] Avoid using unnecessary statements.
- unnecessary_statements
# [ errors/stable ] Equality operator `==` invocation with references of unrelated types.
- unrelated_type_equality_checks
# [ errors/stable ] Avoid unsafe HTML APIs.
- unsafe_html
# [ errors/experimental ] Do not use BuildContexts across async gaps.
- use_build_context_synchronously
# [ errors/stable ] Use key in widget constructors.
- use_key_in_widget_constructors
# [ errors/stable ] Use valid regular expression syntax.
- valid_regexps
# [ pub/stable ] Depend on referenced packages.
- depend_on_referenced_packages
# [ pub/stable ] Use `lowercase_with_underscores` for package names.
- package_names
# [ pub/stable ] Use secure urls in `pubspec.yaml`.
- secure_pubspec_urls
# [ pub/stable ] Sort pub dependencies alphabetically.
- sort_pub_dependencies
# [ style/stable ] Declare method return types.
- always_declare_return_types
# [ style/stable ] Separate the control structure expression from its statement.
- always_put_control_body_on_new_line
# [ style/stable ] Put required named parameters first.
- always_put_required_named_parameters_first
# [ style/deprecated ] Specify `@required` on named parameters without defaults.
- always_require_non_null_named_parameters
# [ style/stable ] Specify type annotations.
- always_specify_types
# [ style/stable ] Annotate overridden members.
- annotate_overrides
# [ style/stable ] Avoid annotating with dynamic when not required.
- avoid_annotating_with_dynamic
# [ style/removed ] Avoid using `as`.
# - avoid_as
# [ style/stable ] Avoid bool literals in conditional expressions.
- avoid_bool_literals_in_conditional_expressions
# [ style/stable ] Avoid catches without on clauses.
- avoid_catches_without_on_clauses
# [ style/stable ] Don't explicitly catch Error or types that implement it.
- avoid_catching_errors
# [ style/stable ] Avoid defining a class that contains only static members.
- avoid_classes_with_only_static_members
# [ style/stable ] Avoid double and int checks.
- avoid_double_and_int_checks
# [ style/stable ] Avoid overloading operator == and hashCode on classes not marked `@immutable`.
- avoid_equals_and_hash_code_on_mutable_classes
# [ style/stable ] Avoid escaping inner quotes by converting surrounding quotes.
- avoid_escaping_inner_quotes
# [ style/stable ] Avoid field initializers in const classes.
- avoid_field_initializers_in_const_classes
# [ style/stable ] Avoid final for parameter declarations.
- avoid_final_parameters
# [ style/stable ] Avoid using `forEach` with a function literal.
- avoid_function_literals_in_foreach_calls
# [ style/stable ] Don't implement classes that override `==`.
- avoid_implementing_value_types
# [ style/stable ] Don't explicitly initialize variables to null.
- avoid_init_to_null
# [ style/stable ] Avoid JavaScript rounded ints.
- avoid_js_rounded_ints
# [ style/stable ] Don't declare multiple variables on a single line.
- avoid_multiple_declarations_per_line
# [ style/stable ] Don't check for null in custom == operators.
- avoid_null_checks_in_equality_operators
# [ style/stable ] Avoid positional boolean parameters.
- avoid_positional_boolean_parameters
# [ style/stable ] Avoid private typedef functions.
- avoid_private_typedef_functions
# [ style/stable ] Avoid redundant argument values.
- avoid_redundant_argument_values
# [ style/stable ] Don't rename parameters of overridden methods.
- avoid_renaming_method_parameters
# [ style/stable ] Avoid return types on setters.
- avoid_return_types_on_setters
# [ style/deprecated ] Avoid returning null from members whose return type is bool, double, int, or num.
- avoid_returning_null
# [ style/stable ] Avoid returning null for void.
- avoid_returning_null_for_void
# [ style/stable ] Avoid returning this from methods just to enable a fluent interface.
- avoid_returning_this
# [ style/stable ] Avoid setters without getters.
- avoid_setters_without_getters
# [ style/stable ] Avoid shadowing type parameters.
- avoid_shadowing_type_parameters
# [ style/stable ] Avoid single cascade in expression statements.
- avoid_single_cascade_in_expression_statements
# [ style/stable ] Avoid annotating types for function expression parameters.
- avoid_types_on_closure_parameters
# [ style/stable ] Avoid unnecessary containers.
- avoid_unnecessary_containers
# [ style/stable ] Avoid defining unused parameters in constructors.
- avoid_unused_constructor_parameters
# [ style/stable ] Avoid async functions that return void.
- avoid_void_async
# [ style/stable ] Await only futures.
- await_only_futures
# [ style/stable ] Name extensions using UpperCamelCase.
- camel_case_extensions
# [ style/stable ] Name types using UpperCamelCase.
- camel_case_types
# [ style/stable ] Cascade consecutive method invocations on the same reference.
- cascade_invocations
# [ style/stable ] Don't cast a nullable value to a non nullable type.
- cast_nullable_to_non_nullable
# [ style/stable ] Sort combinator names alphabetically.
- combinators_ordering
# [ style/stable ] Missing conditional import.
- conditional_uri_does_not_exist
# [ style/stable ] Prefer using lowerCamelCase for constant names.
- constant_identifier_names
# [ style/stable ] DO use curly braces for all flow control structures.
- curly_braces_in_flow_control_structures
# [ style/stable ] Attach library doc comments to library directives.
- dangling_library_doc_comments
# [ style/stable ] Missing deprecated annotation.
- deprecated_consistency
# [ style/stable ] Adhere to Effective Dart Guide directives sorting conventions.
- directives_ordering
# [ style/stable ] Do not use environment declared variables.
- do_not_use_environment
# [ style/stable ] Avoid empty catch blocks.
- empty_catches
# [ style/stable ] Use `;` instead of `{}` for empty constructor bodies.
- empty_constructor_bodies
# [ style/removed ] Do use sound null safety.
# - enable_null_safety
# [ style/stable ] Put a single newline at end of file.
- eol_at_end_of_file
# [ style/stable ] Define case clauses for all constants in enum-like classes.
- exhaustive_cases
# [ style/stable ] Name source files using `lowercase_with_underscores`.
- file_names
# [ style/stable ] Use Flutter TODO format: // TODO(username): message, https://URL-to-issue.
- flutter_style_todos
# [ style/stable ] Don't import implementation files from another package.
- implementation_imports
# [ style/stable ] Explicitly tear-off `call` methods when using an object as a Function.
- implicit_call_tearoffs
# [ style/stable ] Join return statement with assignment when possible.
- join_return_with_assignment
# [ style/stable ] Start multiline strings with a newline.
- leading_newlines_in_multiline_strings
# [ style/stable ] Attach library annotations to library directives.
- library_annotations
# [ style/stable ] Name libraries using `lowercase_with_underscores`.
- library_names
# [ style/stable ] Use `lowercase_with_underscores` when specifying a library prefix.
- library_prefixes
# [ style/stable ] Avoid using private types in public APIs.
- library_private_types_in_public_api
# [ style/stable ] Avoid lines longer than 80 characters.
- lines_longer_than_80_chars
# [ style/stable ] Use matching super parameter names.
- matching_super_parameters
# [ style/stable ] Missing whitespace between adjacent strings.
- missing_whitespace_between_adjacent_strings
# [ style/experimental ] No default cases.
- no_default_cases
# [ style/stable ] Avoid leading underscores for library prefixes.
- no_leading_underscores_for_library_prefixes
# [ style/stable ] Avoid leading underscores for local identifiers.
- no_leading_underscores_for_local_identifiers
# [ style/stable ] Don't compare booleans to boolean literals.
- no_literal_bool_comparisons
# [ style/stable ] Avoid calling toString() on runtimeType.
- no_runtimeType_toString
# [ style/stable ] Name non-constant identifiers using lowerCamelCase.
- non_constant_identifier_names
# [ style/stable ] Noop primitive operations.
- noop_primitive_operations
# [ style/stable ] Don't use null check on a potentially nullable type parameter.
- null_check_on_nullable_type_parameter
# [ style/stable ] Do not pass `null` as an argument where a closure is expected.
- null_closures
# [ style/stable ] Omit type annotations for local variables.
- omit_local_variable_types
# [ style/stable ] Avoid defining a one-member abstract class when a simple function will do.
- one_member_abstracts
# [ style/stable ] Only throw instances of classes extending either Exception or Error.
- only_throw_errors
# [ style/stable ] Don't override fields.
- overridden_fields
# [ style/stable ] Provide doc comments for all public APIs.
- package_api_docs
# [ style/stable ] Prefix library names with the package name and a dot-separated path.
- package_prefixed_library_names
# [ style/stable ] Don't reassign references to parameters of functions or methods.
- parameter_assignments
# [ style/stable ] Use adjacent strings to concatenate string literals.
- prefer_adjacent_string_concatenation
# [ style/stable ] Prefer putting asserts in initializer lists.
- prefer_asserts_in_initializer_lists
# [ style/stable ] Prefer asserts with message.
- prefer_asserts_with_message
# [ style/removed ] Prefer using a boolean as the assert condition.
# - prefer_bool_in_asserts
# [ style/stable ] Use collection literals when possible.
- prefer_collection_literals
# [ style/stable ] Prefer using `??=` over testing for null.
- prefer_conditional_assignment
# [ style/stable ] Prefer const with constant constructors.
- prefer_const_constructors
# [ style/stable ] Prefer declaring const constructors on `@immutable` classes.
- prefer_const_constructors_in_immutables
# [ style/stable ] Prefer const over final for declarations.
- prefer_const_declarations
# [ style/stable ] Prefer const literals as parameters of constructors on @immutable classes.
- prefer_const_literals_to_create_immutables
# [ style/stable ] Prefer defining constructors instead of static methods to create instances.
- prefer_constructors_over_static_methods
# [ style/stable ] Use contains for `List` and `String` instances.
- prefer_contains
# [ style/stable ] Prefer double quotes where they won't require escape sequences.
- prefer_double_quotes
# [ style/removed ] Use `=` to separate a named parameter from its default value.
# - prefer_equal_for_default_values
# [ style/stable ] Use => for short members whose body is a single return statement.
- prefer_expression_function_bodies
# [ style/stable ] Private field could be final.
- prefer_final_fields
# [ style/stable ] Prefer final in for-each loop variable if reference is not reassigned.
- prefer_final_in_for_each
# [ style/stable ] Prefer final for variable declarations if they are not reassigned.
- prefer_final_locals
# [ style/stable ] Prefer final for parameter declarations if they are not reassigned.
- prefer_final_parameters
# [ style/stable ] Prefer 'for' elements when building maps from iterables.
- prefer_for_elements_to_map_fromIterable
# [ style/stable ] Use `forEach` to only apply a function to all the elements.
- prefer_foreach
# [ style/stable ] Use a function declaration to bind a function to a name.
- prefer_function_declarations_over_variables
# [ style/stable ] Prefer generic function type aliases.
- prefer_generic_function_type_aliases
# [ style/stable ] Prefer if elements to conditional expressions where possible.
- prefer_if_elements_to_conditional_expressions
# [ style/stable ] Prefer using if null operators.
- prefer_if_null_operators
# [ style/stable ] Use initializing formals when possible.
- prefer_initializing_formals
# [ style/stable ] Inline list item declarations where possible.
- prefer_inlined_adds
# [ style/stable ] Prefer int literals over double literals.
- prefer_int_literals
# [ style/stable ] Use interpolation to compose strings and values.
- prefer_interpolation_to_compose_strings
# [ style/stable ] Use `isEmpty` for Iterables and Maps.
- prefer_is_empty
# [ style/stable ] Use `isNotEmpty` for Iterables and Maps.
- prefer_is_not_empty
# [ style/stable ] Prefer is! operator.
- prefer_is_not_operator
# [ style/stable ] Prefer to use whereType on iterable.
- prefer_iterable_whereType
# [ style/stable ] Prefer using mixins.
- prefer_mixin
# [ style/stable ] Prefer null aware method calls.
- prefer_null_aware_method_calls
# [ style/stable ] Prefer using null aware operators.
- prefer_null_aware_operators
# [ style/stable ] Only use double quotes for strings containing single quotes.
- prefer_single_quotes
# [ style/stable ] Use spread collections when possible.
- prefer_spread_collections
# [ style/stable ] Prefer typing uninitialized variables and fields.
- prefer_typing_uninitialized_variables
# [ style/stable ] Provide a deprecation message, via @Deprecated("message").
- provide_deprecation_message
# [ style/stable ] Document all public members.
- public_member_api_docs
# [ style/stable ] Property getter recursively returns itself.
- recursive_getters
# [ style/stable ] Use trailing commas for all function calls and declarations.
- require_trailing_commas
# [ style/stable ] SizedBox for whitespace.
- sized_box_for_whitespace
# [ style/stable ] Use SizedBox shrink and expand named constructors.
- sized_box_shrink_expand
# [ style/stable ] Prefer using /// for doc comments.
- slash_for_doc_comments
# [ style/stable ] Sort child properties last in widget instance creations.
- sort_child_properties_last
# [ style/stable ] Sort constructor declarations before other members.
- sort_constructors_first
# [ style/stable ] Sort unnamed constructor declarations first.
- sort_unnamed_constructors_first
# [ style/removed ] Place the `super` call last in a constructor initialization list.
# - super_goes_last
# [ style/stable ] Tighten type of initializing formal.
- tighten_type_of_initializing_formals
# [ style/stable ] Type annotate public APIs.
- type_annotate_public_apis
# [ style/stable ] Don't type annotate initializing formals.
- type_init_formals
# [ style/stable ] Don't use constant patterns with type literals.
- type_literal_in_constant_pattern
# [ style/stable ] `Future` results in `async` function bodies must be `await`ed or marked `unawaited` using `dart:async`.
- unawaited_futures
# [ style/stable ] Unnecessary await keyword in return.
- unnecessary_await_in_return
# [ style/stable ] Avoid using braces in interpolation when not needed.
- unnecessary_brace_in_string_interps
# [ style/stable ] Don't use explicit `break`s when a break is implied.
- unnecessary_breaks
# [ style/stable ] Avoid const keyword.
- unnecessary_const
# [ style/stable ] Unnecessary `.new` constructor name.
- unnecessary_constructor_name
# [ style/stable ] Don't use `final` for local variables.
- unnecessary_final
# [ style/stable ] Avoid wrapping fields in getters and setters just to be "safe".
- unnecessary_getters_setters
# [ style/stable ] Don't create a lambda when a tear-off will do.
- unnecessary_lambdas
# [ style/stable ] Don't specify the `late` modifier when it is not needed.
- unnecessary_late
# [ style/stable ] Avoid library directives unless they have documentation comments or annotations.
- unnecessary_library_directive
# [ style/stable ] Unnecessary new keyword.
- unnecessary_new
# [ style/stable ] Avoid null in null-aware assignment.
- unnecessary_null_aware_assignments
# [ style/stable ] Unnecessary null aware operator on extension on a nullable type.
- unnecessary_null_aware_operator_on_extension_on_nullable
# [ style/experimental ] Unnecessary null checks.
- unnecessary_null_checks
# [ style/stable ] Avoid using `null` in `if null` operators.
- unnecessary_null_in_if_null_operators
# [ style/stable ] Use a non-nullable type for a final variable initialized with a non-nullable value.
- unnecessary_nullable_for_final_variable_declarations
# [ style/stable ] Don't override a method to do a super method invocation with the same parameters.
- unnecessary_overrides
# [ style/stable ] Unnecessary parentheses can be removed.
- unnecessary_parenthesis
# [ style/stable ] Unnecessary raw string.
- unnecessary_raw_strings
# [ style/stable ] Remove unnecessary backslashes in strings.
- unnecessary_string_escapes
# [ style/stable ] Unnecessary string interpolation.
- unnecessary_string_interpolations
# [ style/stable ] Don't access members with `this` unless avoiding shadowing.
- unnecessary_this
# [ style/stable ] Unnecessary toList() in spreads.
- unnecessary_to_list_in_spreads
# [ style/experimental ] Unreachable top-level members in executable libraries.
- unreachable_from_main
# [ style/stable ] Use `ColoredBox`.
- use_colored_box
# [ style/stable ] Use `DecoratedBox`.
- use_decorated_box
# [ style/stable ] Use enums rather than classes that behave like enums.
- use_enums
# [ style/stable ] Prefer an 8-digit hexadecimal integer(0xFFFFFFFF) to instantiate Color.
- use_full_hex_values_for_flutter_colors
# [ style/stable ] Use generic function type syntax for parameters.
- use_function_type_syntax_for_parameters
# [ style/stable ] Use if-null operators to convert nulls to bools.
- use_if_null_to_convert_nulls_to_bools
# [ style/stable ] Prefer intValue.isOdd/isEven instead of checking the result of % 2.
- use_is_even_rather_than_modulo
# [ style/experimental ] Use late for private members with a non-nullable type.
- use_late_for_private_fields_and_variables
# [ style/stable ] Use predefined named constants.
- use_named_constants
# [ style/stable ] Use raw string to avoid escapes.
- use_raw_strings
# [ style/stable ] Use rethrow to rethrow a caught exception.
- use_rethrow_when_possible
# [ style/stable ] Use a setter for operations that conceptually change a property.
- use_setters_to_change_properties
# [ style/stable ] Use string buffers to compose strings.
- use_string_buffers
# [ style/stable ] Use string in part of directives.
- use_string_in_part_of_directives
# [ style/experimental ] Use super-initializer parameters where possible.
- use_super_parameters
# [ style/stable ] Use throwsA matcher instead of fail().
- use_test_throws_matchers
# [ style/stable ] Start the name of the method with to/_to or as/_as if applicable.
- use_to_and_as_if_applicable
# [ style/stable ] Don't assign to void.
- void_checks