-
Notifications
You must be signed in to change notification settings - Fork 1
/
analysis_options.yaml
1159 lines (940 loc) · 43.6 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
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
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
# linter rules based on dart SDK 2.17.6, linter version 1.22.0 - updated 11-August-2022
# https://github.com/dart-lang/sdk/blob/main/CHANGELOG.md
# https://pub.dev/documentation/analyzer/latest/
# https://dart.dev/tools/linter-rules
# https://github.com/dart-lang/linter/blob/main/example/all.yaml
# https://github.com/dart-lang/lints/blob/main/lib/core.yaml
# https://github.com/dart-lang/lints/blob/main/lib/recommended.yaml
# https://github.com/flutter/packages/blob/main/packages/flutter_lints/lib/flutter.yaml
# https://github.com/passsy/dart-lint/releases
# Archived
# https://github.com/google/pedantic
# https://github.com/tenhobi/effective_dart
analyzer:
exclude:
#### CUSTOM
- build/**
- lib/generated/**
- lib/**.g.dart
- lib/**.gr.dart
language:
# Value of true ensures that the type inference engine never implicitly casts to a more specific type
# https://github.com/dart-lang/language/blob/main/resources/type-system/strict-casts.md
strict-casts: true
# Value of true ensures that the type inference engine never chooses the dynamic type when it can’t determine a static type
# https://github.com/dart-lang/language/blob/main/resources/type-system/strict-raw-types.md
strict-raw-types: true
errors:
missing_required_param: error
missing_return: error
todo: ignore
# _______________________ core + recommended + flutter (effective_dart) + pedantic _______________________
# Group: ERRORS
always_use_package_imports: error
avoid_dynamic_calls: error
avoid_empty_else: error # core recommended flutter // pedantic
avoid_print: warning # flutter
# avoid_relative_lib_imports: warning # doesn't work core recommended flutter // pedantic effective_dart
avoid_types_as_parameter_names: error # core recommended flutter // pedantic
# avoid_web_libraries_in_flutter: ignore # flutter
cancel_subscriptions: error
collection_methods_unrelated_type: error
control_flow_in_finally: error # recommended flutter
# discarded_futures: error
empty_statements: error # recommended flutter
hash_and_equals: error # core recommended flutter // effective_dart
no_duplicate_case_values: error # core recommended flutter // pedantic
no_logic_in_create_state: error # flutter
# prefer_relative_imports: ignore # // effective_dart
prefer_void_to_null: error # recommended flutter
unrelated_type_equality_checks: error # core recommended flutter // pedantic
# unsafe_html: error # // pedantic
use_key_in_widget_constructors: error # flutter
valid_regexps: error # core recommended flutter // pedantic
# Group: STYLES
always_declare_return_types: error # // pedantic
always_put_control_body_on_new_line: error
always_require_non_null_named_parameters: error # recommended flutter // pedantic
annotate_overrides: error # recommended flutter // pedantic
# avoid_catches_without_on_clauses: ignore # doesn't catch all exceptions when using "on" clause // effective_dart
avoid_catching_errors: error # // effective_dart
# avoid_classes_with_only_static_members: ignore # // effective_dart
# avoid_equals_and_hash_code_on_mutable_classes: ignore # // effective_dart
avoid_function_literals_in_foreach_calls: error # recommended flutter // effective_dart
avoid_init_to_null: error # recommended flutter // pedantic effective_dart
avoid_null_checks_in_equality_operators: error # recommended flutter // pedantic effective_dart
avoid_positional_boolean_parameters: error # // effective_dart
# avoid_private_typedef_functions: ignore # // effective_dart
avoid_renaming_method_parameters: error # recommended flutter
avoid_return_types_on_setters: error # recommended flutter // pedantic effective_dart
avoid_returning_null: error # // effective_dart
avoid_returning_null_for_void: error # recommended flutter
avoid_returning_this: error # // effective_dart
# avoid_setters_without_getters: error # // effective_dart
avoid_shadowing_type_parameters: error # core recommended flutter // pedantic
avoid_single_cascade_in_expression_statements: error # recommended flutter // pedantic
# avoid_types_on_closure_parameters: ignore # // effective_dart
avoid_unnecessary_containers: error # flutter
await_only_futures: error # core recommended flutter // pedantic
camel_case_extensions: error # core recommended flutter // pedantic effective_dart
camel_case_types: error # core recommended // flutter effective_dart
constant_identifier_names: error # recommended flutter // effective_dart
directives_ordering: error # // effective_dart
empty_catches: error # core recommended flutter // pedantic
empty_constructor_bodies: error # recommended flutter // pedantic effective_dart
exhaustive_cases: error # recommended flutter
file_names: error # core recommended flutter // effective_dart
implementation_imports: error # recommended flutter // effective_dart
library_names: error # recommended flutter // pedantic effective_dart
library_prefixes: error # recommended flutter // pedantic effective_dart
# lines_longer_than_80_chars: ignore # // effective_dart
non_constant_identifier_names: error # core recommended flutter // effective_dart
no_leading_underscores_for_library_prefixes: error # recommended flutter
no_leading_underscores_for_local_identifiers: error # recommended flutter
null_check_on_nullable_type_parameter: error # core recommended flutter
curly_braces_in_flow_control_structures: error #core recommended flutter // pedantic effective_dart
null_closures: error # recommended flutter // pedantic
#omit_local_variable_types: ignore # // pedantic effective_dart
# one_member_abstracts: error # // effective_dart
overridden_fields: error # recommended flutter
package_api_docs: error # // effective_dart
package_prefixed_library_names: error # core recommended flutter
prefer_adjacent_string_concatenation: error # recommended flutter // pedantic effective_dart
prefer_collection_literals: error # recommended flutter // pedantic effective_dart
prefer_conditional_assignment: error # recommended flutter // pedantic
prefer_const_constructors: error # flutter
prefer_const_constructors_in_immutables: error # flutter
prefer_const_declarations: error # flutter
prefer_const_literals_to_create_immutables: error # flutter
prefer_contains: error # recommended flutter // pedantic
prefer_equal_for_default_values: error # recommended flutter // pedantic effective_dart
prefer_final_fields: error # recommended flutter // pedantic effective_dart
prefer_for_elements_to_map_fromIterable: error # recommended flutter // pedantic
prefer_function_declarations_over_variables: error # recommended flutter // effective_dart
prefer_generic_function_type_aliases: error # core recommended flutter // pedantic effective_dart
prefer_if_null_operators: error # recommended flutter // pedantic
prefer_initializing_formals: error # recommended flutter // effective_dart
prefer_inlined_adds: error # recommended flutter // pedantic
prefer_interpolation_to_compose_strings: error # // effective_dart
prefer_is_empty: error # core recommended flutter // pedantic effective_dart
prefer_is_not_empty: error # core recommended flutter // pedantic effective_dart
prefer_is_not_operator: error # recommended flutter
prefer_iterable_whereType: error # core recommended flutter // pedantic effective_dart
prefer_mixin: error # // effective_dart
prefer_null_aware_operators: error # recommended flutter
prefer_single_quotes: error # // pedantic
prefer_spread_collections: error # recommended flutter // pedantic
prefer_typing_uninitialized_variables: error # core recommended flutter
provide_deprecation_message: error # core recommended flutter
#public_member_api_docs: ignore # // effective_dart
recursive_getters: error # recommended flutter // pedantic
sized_box_for_whitespace: error # flutter
slash_for_doc_comments: error # recommended flutter // pedantic effective_dart
sort_child_properties_last: error # // pedantic
type_annotate_public_apis: error # // effective_dart
type_init_formals: error # recommended flutter // pedantic effective_dart
unawaited_futures: error # // pedantic
unnecessary_await_in_return: error
# unnecessary_brace_in_string_interps: ignore # recommended flutter // pednatic effective_dart
unnecessary_const: error # recommended flutter // pedantic effective_dart
unnecessary_getters_setters: error # recommended flutter // pedantic effective_dart
unnecessary_lambdas: error # // effective_dart
unnecessary_late: error # recommended flutter
unnecessary_new: error # recommended flutter // pedantic effective_dart
unnecessary_null_in_if_null_operators: error # recommended flutter // pedantic
unnecessary_overrides: error # core recommended flutter
unnecessary_string_escapes: error # recommended flutter
unnecessary_string_interpolations: error # recommended flutter
unnecessary_this: error # recommended flutter // pedantic effective_dart
use_full_hex_values_for_flutter_colors: error # flutter // pedantic
use_function_type_syntax_for_parameters: error # recommended flutter // pedantic
use_rethrow_when_possible: error # recommended flutter // pedantic effective_dart
# use_setters_to_change_properties: ignore # // effective_dart
use_to_and_as_if_applicable: error # // effective_dart
void_checks: error # core recommended flutter
# Group: RULES
depend_on_referenced_packages: error # core recommended flutter
package_names: error # recommended flutter
secure_pubspec_urls: error
# _______________________ custom _______________________
# Group: STYLES
always_put_required_named_parameters_first: error
always_specify_types: error
avoid_bool_literals_in_conditional_expressions: error
avoid_double_and_int_checks: error
avoid_escaping_inner_quotes: error
avoid_js_rounded_ints: error
avoid_returning_null_for_future: error
avoid_unused_constructor_parameters: error
avoid_void_async: error
cascade_invocations: error
deprecated_consistency: error
flutter_style_todos: error
leading_newlines_in_multiline_strings: error
literal_only_boolean_expressions: error
missing_whitespace_between_adjacent_strings: error
no_adjacent_strings_in_list: error
parameter_assignments: error
prefer_asserts_with_message: error
prefer_expression_function_bodies: ignore # change to error for REFACTOR only
prefer_if_elements_to_conditional_expressions: error # debatable
sort_unnamed_constructors_first: error
unnecessary_parenthesis: error
unnecessary_raw_strings: error
unnecessary_statements: error
use_is_even_rather_than_modulo: error
use_named_constants: error
use_raw_strings: error
use_string_buffers: error
linter:
rules:
# __________________________________________________Error Rules__________________________________________________
# Dart SDK: >= 2.10.0 • (Linter v0.1.118)
# Avoid relative imports for files in lib/.
- always_use_package_imports # overlaps with avoid_relative_lib_imports
# Dart SDK: unreleased
# Avoid method calls or property accesses on a "dynamic" target.
- avoid_dynamic_calls
# Dart SDK: >= 2.0.0 • (Linter v0.1.8)
# Avoid empty else statements.
# core recommended flutter // pedantic
- avoid_empty_else
# Dart SDK: >= 2.5.0-dev.1.0 • (Linter v0.1.93)
# Avoid print calls in production code.
# flutter
- avoid_print
# Dart SDK: >= 2.0.0 • (Linter v0.1.44)
# Avoid relative imports for files in lib/.
# core recommended flutter // pedantic effective_dart
#- avoid_relative_lib_imports # overlaps with always_use_package_imports
# Dart SDK: >= 2.1.1-dev.0.0 • (Linter v0.1.72)
# Avoid returning null for Future.
- avoid_returning_null_for_future
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Avoid slow async dart:io methods.
#- avoid_slow_async_io
# Dart SDK: >= 2.10.0-144.0.dev • (Linter v0.1.119)
# Avoid .toString() in production code since results male to bylay be minified.
#- avoid_type_to_string
# Dart SDK: >= 2.0.0 • (Linter v0.1.45)
# Avoid types as parameter names.
# core recommended flutter // pedantic
- avoid_types_as_parameter_names
# Dart SDK: >= 2.6.0 • (Linter v0.1.101)
# Avoid using web-only libraries outside Flutter web plugin packages.
# flutter
#- avoid_web_libraries_in_flutter
# Dart SDK: >= 2.0.0 • (Linter v0.1.20)
# Cancel instances of dart.async.StreamSubscription.
- cancel_subscriptions
# Dart SDK: >= 2.0.0 • (Linter v0.1.19)
# Close instances of dart.core.Sink.
#- close_sinks
# Dart SDK: >= 2.19.0 • (Linter v2.0.20)
# Invocation of various collection methods with arguments of unrelated types.
- collection_methods_unrelated_type
# Dart SDK: >= 2.0.0 • (Linter v0.1.17)
# Only reference in scope identifiers in doc comments.
#- comment_references
# Dart SDK: >= 2.0.0 • (Linter v0.1.16)
# Avoid control flow in finally blocks.
# recommended flutter
- control_flow_in_finally
# Dart SDK: >= 2.2.1-dev.4.0 • (Linter v0.1.85)
# DO reference all public properties in debug methods.
#- diagnostic_describe_all_properties
# Linter v1.25
# Making asynchronous calls in non-async functions is usually the sign of a programming error.
# In general these functions should be marked async and such futures should likely be awaited
# (as enforced by unawaited_futures).
# DON'T invoke asynchronous functions in non-async blocks.
#- discarded_futures
# Dart SDK: >= 2.0.0 • (Linter v0.1.21)
# Avoid empty statements.
# recommended flutter
- empty_statements
# Dart SDK: >= 2.0.0 • (Linter v0.1.11)
# Always override hashCode if overriding ==.
# core recommended flutter // effective_dart
- hash_and_equals
# Dart SDK: >= 2.0.0 • (Linter v0.1.25)
# Conditions should not unconditionally evaluate to true or to false.
#- invariant_booleans (experimental).
# Dart SDK: >= 2.0.0 • (Linter v0.1.25)
# Boolean expression composed only with literals.
- literal_only_boolean_expressions
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Don't use adjacent strings in list.
- no_adjacent_strings_in_list
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Don't use more than one case with same value.
# core recommended flutter // pedantic
- no_duplicate_case_values
# Dart SDK: >= 2.8.0-dev.1.0 • (Linter v0.1.106)
# Don't put any logic in createState.
# flutter
- no_logic_in_create_state
# Dart SDK: >= 2.6.0-dev.5.0 • (Linter v0.1.99)
# Prefer relative imports for files in lib/.
# // effective_dart
#- prefer_relative_imports: false
# Dart SDK: >= 2.1.0-dev.1.0 • (Linter v0.1.59)
# Don't use the Null type, unless you are positive that you don't want void.
# recommended flutter
- prefer_void_to_null
# Dart SDK: >= 2.0.0 • (Linter v0.1.16)
# Test type arguments in operator ==(Object other).
#- test_types_in_equals
# Dart SDK: >= 2.0.0 • (Linter v0.1.16)
# Avoid throw in finally block.
#- throw_in_finally
# Dart SDK: >= 2.0.0 • (Linter v0.1.36)
# Avoid using unnecessary statements.
- unnecessary_statements
# Dart SDK: >= 2.0.0 • (Linter v0.1.16)
# Equality operator == invocation with references of unrelated types.
# core recommended flutter // pedantic
- unrelated_type_equality_checks
# Dart SDK: >= 2.3.2-dev.0.1 • (Linter v0.1.90)
# Avoid unsafe HTML APIs.
# // pedantic
# - unsafe_html
# Dart SDK: unreleased.
# Do not use BuildContexts across async gaps.
#- use_build_context_synchronously (experimental)
# Dart SDK: >= 2.8.0-dev.1.0 • (Linter v0.1.108)
# Use key in widget constructors.
# flutter
- use_key_in_widget_constructors
# Dart SDK: >= 2.0.0 • (Linter v0.1.22)
# Use valid regular expression syntax.
# core recommended flutter // pedantic
- valid_regexps
# __________________________________________________Style Rules__________________________________________________
# Dart SDK: >= 2.0.0 • (Linter v0.1.4)
# Declare method return types.
# // pedantic
- always_declare_return_types
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Separate the control structure expression from its statement.
- always_put_control_body_on_new_line
# Dart SDK: >= 2.0.0 • (Linter v0.1.33)
# Put @required named parameters first.
- always_put_required_named_parameters_first
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Specify @required on named parameters without defaults.
# recommended flutter // pedantic
- always_require_non_null_named_parameters
# Dart SDK: >= 2.0.0 • (Linter v0.1.4)
# Specify type annotations.
- always_specify_types
# Dart SDK: >= 2.0.0 • (Linter v0.1.11)
# Annotate overridden members.
# recommended flutter // pedantic
- annotate_overrides
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Avoid annotating with dynamic when not required.
#- avoid_annotating_with_dynamic
# Dart SDK: >= 2.0.0 • (Linter v0.1.5)
# Avoid using as.
#- avoid_as (deprecated)
# Dart SDK: >= 2.0.0 • (Linter v0.1.46)
# Avoid bool literals in conditional expressions.
- avoid_bool_literals_in_conditional_expressions
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Avoid catches without on clauses.
# // effective_dart
#- avoid_catches_without_on_clauses
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Don't explicitly catch Error or types that implement it.
# // effective_dart
- avoid_catching_errors
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Avoid defining a class that contains only static members.
# // effective_dart
#- avoid_classes_with_only_static_members: false
# Dart SDK: >= 2.0.0 • (Linter v0.1.47)
# Avoid double and int checks.
- avoid_double_and_int_checks
# Dart SDK: >= 2.6.0-dev.3.0 • (Linter v0.1.97)
# Avoid overloading operator == and hashCode on classes not marked @immutable.
# // effective_dart
#- avoid_equals_and_hash_code_on_mutable_classes: false
# Dart SDK: >= 2.8.0-dev.11.0 • (Linter v0.1.111)
# Avoid escaping inner quotes by converting surrounding quotes.
- avoid_escaping_inner_quotes
# Dart SDK: >= 2.0.0 • (Linter v0.1.48)
# Avoid field initializers in const classes.
#- avoid_field_initializers_in_const_classes
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Avoid using forEach with a function literal.
# recommended flutter // effective_dart
- avoid_function_literals_in_foreach_calls
# Dart SDK: >= 2.1.0-dev.5.0 • (Linter v0.1.62)
# Don't implement classes that override ==.
#- avoid_implementing_value_types
# Dart SDK: >= 2.0.0 • (Linter v0.1.11)
# Don't explicitly initialize variables to null.
# recommended flutter // pedantic effective_dart
- avoid_init_to_null
# Dart SDK: >= 2.0.0 • (Linter v0.1.48)
# Avoid JavaScript rounded ints.
- avoid_js_rounded_ints
# Dart SDK: unreleased
# Don't declare multiple variables on a single line.
#- avoid_multiple_declarations_per_line
# dart Don't check for null in custom == operators.
# recommended flutter // pedantic effective_dart
- avoid_null_checks_in_equality_operators
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Avoid positional boolean parameters.
# // effective_dart
- avoid_positional_boolean_parameters
# Dart SDK: >= 2.0.0 • (Linter v0.1.46)
# Avoid private typedef functions.
# // effective_dart
#- avoid_private_typedef_functions: false
# Dart SDK: >= 2.8.0-dev.1.0 • (Linter v0.1.107)
# Avoid redundant argument values.
#- avoid_redundant_argument_values
# Dart SDK: >= 2.0.0 • (Linter v0.1.45)
# Don't rename parameters of overridden methods.
# recommended flutter
- avoid_renaming_method_parameters
# Dart SDK: >= 2.0.0 • (Linter v0.1.11)
# Avoid return types on setters.
# recommended flutter // pedantic effective_dart
- avoid_return_types_on_setters
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Avoid returning null from members whose return type is bool, double, int, or num.
# // effective_dart
- avoid_returning_null
# Dart SDK: >= 2.1.0-dev.8.0 • (Linter v0.1.69)
# Avoid returning null for void.
# recommended flutter
- avoid_returning_null_for_void
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Avoid returning this from methods just to enable a fluent interface.
# // effective_dart
- avoid_returning_this
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Avoid setters without getters.
# // effective_dart
#- avoid_setters_without_getters
# Dart SDK: >= 2.1.1-dev.0.0 • (Linter v0.1.72)
# Avoid shadowing type parameters.
# core recommended flutter // pedantic
- avoid_shadowing_type_parameters
# Dart SDK: >= 2.0.0 • (Linter v0.1.46)
# Avoid single cascade in expression statements.
# recommended flutter // pedantic
- avoid_single_cascade_in_expression_statements
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Avoid annotating types for function expression parameters.
# // effective_dart
#- avoid_types_on_closure_parameters: false
# Dart SDK: >= 2.7.0-dev.0.0 • (Linter v0.1.102)
# Avoid unnecessary containers.
# flutter
- avoid_unnecessary_containers
# Dart SDK: >= 2.0.0 • (Linter v0.1.36)
# Avoid defining unused parameters in constructors.
- avoid_unused_constructor_parameters
# Dart SDK: >= 2.1.0-dev.3.0 • (Linter v0.1.60)
# Avoid async functions that return void.
- avoid_void_async
# Dart SDK: >= 2.0.0 • (Linter v0.1.16)
# Await only futures.
# core recommended flutter // pedantic
- await_only_futures
# Dart SDK: >= 2.6.0-dev.0.0 • (Linter v0.1.97+1)
# Name extensions using UpperCamelCase.
# core recommended flutter // pedantic effective_dart
- camel_case_extensions
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Name types using UpperCamelCase.
# core recommended // flutter effective_dart
- camel_case_types
# Dart SDK: >= 2.0.0 • (Linter v0.1.29)
# Cascade consecutive method invocations on the same reference.
- cascade_invocations
# Dart SDK: >= 2.11.0-182.0.dev • (Linter v0.1.120)
# Don't cast a nullable value to a non nullable type.
#- cast_nullable_to_non_nullable (experimental)
# Linter v1.26
# DO sort combinator names alphabetically.
# - combinators_ordering
# Linter v1.16.0
# DON'T reference files that do not exist in conditional imports.
# Code may fail at runtime if the condition evaluates such that the missing file needs to be imported.
- conditional_uri_does_not_exist
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Prefer using lowerCamelCase for constant names.
# recommended flutter // effective_dart
- constant_identifier_names
# Dart SDK: >= 2.0.0 • (Linter v0.1.57)
# DO use curly braces for all flow control structures.
# core recommended flutter // pedantic effective_dart
- curly_braces_in_flow_control_structures
# (Linter vnull)
# Missing deprecated annotation.
- deprecated_consistency
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Adhere to effective_dart Guide directives sorting conventions.
# // effective_dart
- directives_ordering
# Dart SDK: >= 2.10.0-0.0.dev • (Linter v0.1.117)
# Do not use environment declared variables.
#- do_not_use_environment
# Dart SDK: >= 2.0.0 • (Linter v0.1.22)
# Avoid empty catch blocks.
# core recommended flutter // pedantic
- empty_catches
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Use ; instead of {} for empty constructor bodies.
# recommended flutter // pedantic effective_dart
- empty_constructor_bodies
# (Linter vnull)
# DO put a single newline at the end of non-empty files.
#- eol_at_end_of_file
# Dart SDK: >= 2.9.0-12.0.dev • (Linter v0.1.116)
# Define case clauses for all constants in enum-like classes.
# recommended flutter
- exhaustive_cases
# Dart SDK: >= 2.0.0 • (Linter v0.1.54)
# Name source files using lowercase_with_underscores.
# core recommended flutter // effective_dart
- file_names
# Dart SDK: >= 2.1.0-dev.5.0 • (Linter v0.1.61)
# Use Flutter TO DO format: // TO DO(username): message, https://URL-to-issue.
- flutter_style_todos
# Dart SDK: >= 2.0.0 • (Linter v0.1.4)
# Don't import implementation files from another package.
# recommended flutter // effective_dart
- implementation_imports
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Join return statement with assignment when possible.
#- join_return_with_assignment
# Dart SDK: >= 2.8.0-dev.16.0 • (Linter v0.1.113)
# Start multiline strings with a newline.
- leading_newlines_in_multiline_strings
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Name libraries using lowercase_with_underscores.
# recommended flutter // pedantic effective_dart
- library_names
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Use lowercase_with_underscores when specifying a library prefix.
# recommended flutter // pedantic effective_dart
- library_prefixes
# (Linter vnull)
# AVOID using library private types in public APIs.
#- library_private_types_in_public_api
# Dart SDK: >= 2.0.0 • (Linter v0.1.56)
# Avoid lines longer than 80 characters.
# // effective_dart
#- lines_longer_than_80_chars: false
# Dart SDK: >= 2.8.0-dev.10.0 • (Linter v0.1.110)
# Missing whitespace between adjacent strings.
- missing_whitespace_between_adjacent_strings
# Dart SDK: >= 2.9.0-12.0.dev • (Linter v0.1.116)
# No default cases.
#- no_default_cases (experimental)
# Dart SDK: >= 2.8.0-dev.10.0 • (Linter v0.1.110)
# Avoid calling toString() on runtimeType.
#- no_runtimeType_toString
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Name non-constant identifiers using lowerCamelCase.
# core recommended flutter // effective_dart
- non_constant_identifier_names
# Linter v1.15
# DON’T use a leading underscore for library prefixes. There is no concept of "private" for library prefixes.
# When one of those has a name that starts with an underscore, it sends a confusing signal to the reader.
# To avoid that, don't use leading underscores in those names.
# recommended flutter
- no_leading_underscores_for_library_prefixes
# Linter v1.15
# DON’T use a leading underscore for identifiers that aren't private.
# Dart uses a leading underscore in an identifier to mark members and top-level declarations as private.
# This trains users to associate a leading underscore with one of those kinds of declarations.
# They see _ and think "private". There is no concept of "private" for local variables or parameters.
# When one of those has a name that starts with an underscore, it sends a confusing signal to the reader.
# To avoid that, don't use leading underscores in those names.
# recommended flutter
- no_leading_underscores_for_local_identifiers
# (Linter vnull)
# Some operations on primitive types are idempotent and can be removed.
#- noop_primitive_operations
# Dart SDK: >= 2.11.0-182.0.dev • (Linter v0.1.120)
# Don't use null check on a potentially nullable type parameter.
# core recommended flutter
- null_check_on_nullable_type_parameter
# Dart SDK: >= 2.0.0 • (Linter v0.1.56)
# Do not pass null as an argument where a closure is expected.
# recommended flutter // pedantic
- null_closures
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Omit type annotations for local variables.
# // pedantic effective_dart
#- omit_local_variable_types: false
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Avoid defining a one-member abstract class when a simple function will do.
# // effective_dart
# - one_member_abstracts
# Dart SDK: >= 2.0.0 • (Linter v0.1.21)
# Only throw instances of classes extending either Exception or Error.
#- only_throw_errors
# Dart SDK: >= 2.0.0 • (Linter v0.1.18)
# Don't override fields.
# recommended flutter
- overridden_fields
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Provide doc comments for all public APIs.
# // effective_dart
- package_api_docs
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Prefix library names with the package name and a dot-separated path.
# core recommended flutter
- package_prefixed_library_names
# Dart SDK: >= 2.0.0 • (Linter v0.1.27)
# Don't reassign references to parameters of functions or methods.
- parameter_assignments
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Use adjacent strings to concatenate string literals.
# recommended flutter // pedantic effective_dart
- prefer_adjacent_string_concatenation
# Dart SDK: >= 2.0.0 • (Linter v0.1.33)
# Prefer putting asserts in initializer list.
#- prefer_asserts_in_initializer_lists
# Dart SDK: >= 2.2.1-dev.4.0 • (Linter v0.1.84)
# Prefer asserts with message.
- prefer_asserts_with_message
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Prefer using a boolean as the assert condition.
#- prefer_bool_in_asserts (deprecated)
# Dart SDK: >= 2.0.0 • (Linter v0.1.36)
# Use collection literals when possible.
# recommended flutter // pedantic effective_dart
- prefer_collection_literals
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Prefer using ??= over testing for null.
# recommended flutter // pedantic
- prefer_conditional_assignment
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Prefer const with constant constructors.
# flutter
- prefer_const_constructors
# Dart SDK: >= 2.0.0 • (Linter v0.1.33)
# Prefer declaring const constructors on @immutable classes.
# flutter
- prefer_const_constructors_in_immutables
# Dart SDK: >= 2.0.0 • (Linter v0.1.43)
# Prefer const over final for declarations.
# flutter
- prefer_const_declarations
# Dart SDK: >= 2.0.0 • (Linter v0.1.43)
# Prefer const literals as parameters of constructors on @immutable classes.
# flutter
- prefer_const_literals_to_create_immutables
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Prefer defining constructors instead of static methods to create instances.
#- prefer_constructors_over_static_methods
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Use contains for List and String instances.
# recommended flutter // pedantic
- prefer_contains
# Dart SDK: >= 2.3.2-dev.0.0 • (Linter v0.1.88)
# Prefer double quotes where they won't require escape sequences.
#- prefer_double_quotes
# Dart SDK: >= 2.0.0 • (Linter v0.1.46)
# Use = to separate a named parameter from its default value.
# recommended flutter // pedantic effective_dart
- prefer_equal_for_default_values
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Use => for short members whose body is a single return statement.
- prefer_expression_function_bodies
# Dart SDK: >= 2.0.0 • (Linter v0.1.27)
# Private field could be final.
# recommended flutter // pedantic effective_dart
- prefer_final_fields
# Dart SDK: >= 2.1.1 • (Linter v0.1.78)
# Prefer final in for-each loop variable if reference is not reassigned.
#- prefer_final_in_for_each
# Dart SDK: >= 2.0.0 • (Linter v0.1.27)
# Prefer final for variable declarations if they are not reassigned.
#- prefer_final_locals
# (Linter vnull)
# DO prefer declaring parameters as final if they are not reassigned in the function body.
#- prefer_final_parameters
# Dart SDK: >= 2.2.1-dev.4.0 • (Linter v0.1.85)
# Prefer for elements when building maps from iterables.
# recommended flutter // pedantic
- prefer_for_elements_to_map_fromIterable
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
# Use forEach to only apply a function to all the elements.
#- prefer_foreach
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Use a function declaration to bind a function to a name.
# recommended flutter // effective_dart
- prefer_function_declarations_over_variables
# Dart SDK: >= 2.0.0 • (Linter v0.1.47)
# Prefer generic function type aliases.
# core recommended flutter // pedantic effective_dart
- prefer_generic_function_type_aliases
# Dart SDK: >= 2.2.1-dev.4.0 • (Linter v0.1.85)
# Prefer if elements to conditional expressions where possible.
- prefer_if_elements_to_conditional_expressions
# Dart SDK: >= 2.3.2-dev.0.0 • (Linter v0.1.89)
# Prefer using if null operators.
# recommended flutter // pedantic
- prefer_if_null_operators
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Use initializing formals when possible.
# recommended flutter // effective_dart
- prefer_initializing_formals
# Dart SDK: >= 2.3.0 • (Linter v0.1.86)
# Inline list item declarations where possible.
# recommended flutter // pedantic
- prefer_inlined_adds
# Dart SDK: >= 2.1.0 • (Linter v0.1.71)
# Prefer int literals over double literals.
#- prefer_int_literals
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Use interpolation to compose strings and values.
# // effective_dart
- prefer_interpolation_to_compose_strings
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Use isEmpty for Iterables and Maps.
# core recommended flutter // pedantic effective_dart
- prefer_is_empty
# Dart SDK: >= 2.0.0 • (Linter v0.1.5)
# Use isNotEmpty for Iterables and Maps.
# core recommended flutter // pedantic effective_dart
- prefer_is_not_empty
# Dart SDK: >= 2.7.0-dev.0.0 • (Linter v0.1.102)
# When checking if an object is not of a specified type, it is preferable to use the 'is!' operator.
# Prefer is! operator.
# recommended flutter
- prefer_is_not_operator
# Dart SDK: >= 2.0.0 • (Linter v0.1.47)
# Prefer to use whereType on iterable.
# core recommended flutter // pedantic effective_dart
- prefer_iterable_whereType
# Dart SDK: >= 2.1.0-dev.5.0 • (Linter v0.1.62)
# Prefer using mixins.
# // effective_dart
- prefer_mixin
# (Linter vnull)
# Instead of checking nullability of a function/method f before calling it you can use f?.call().
#- prefer_null_aware_method_calls
# Dart SDK: >= 2.2.0 • (Linter v0.1.80)
# Prefer using null aware operators.
# recommended flutter
- prefer_null_aware_operators
# Dart SDK: >= 2.0.0 • (Linter v0.1.33)
# Only use double quotes for strings containing single quotes.
# // pedantic
- prefer_single_quotes
# Dart SDK: >= 2.2.1-dev.4.0 • (Linter v0.1.85)
# Use spread collections when possible.
# recommended flutter // pedantic
- prefer_spread_collections
# Dart SDK: >= 2.0.0 • (Linter v0.1.36)
# Prefer typing uninitialized variables and fields.
# core recommended flutter
- prefer_typing_uninitialized_variables
# Dart SDK: >= 2.2.0 • (Linter v0.1.82)
# Provide a deprecation message, via @Deprecated("message").
# core recommended flutter
- provide_deprecation_message
# Dart SDK: >= 2.0.0 • (Linter v0.1.11)
# Document all public members.
# // effective_dart
#- public_member_api_docs: false
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Property getter recursively returns itself.
# recommended flutter // pedantic
- recursive_getters
# (Linter vnull)
# DO use trailing commas for all function calls and declarations unless the function call or definition,
# from the start of the function name up to the closing parenthesis, fits in a single line.
#- require_trailing_commas (experimental)
# Dart SDK: >= 2.9.0-10.0.dev • (Linter v0.1.115)
# SizedBox for whitespace.
# flutter
- sized_box_for_whitespace
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Prefer using /// for doc comments.
# recommended flutter // pedantic effective_dart
- slash_for_doc_comments
# Dart SDK: >= 2.3.2-dev.0.0 • (Linter v0.1.88)
# Sort child properties last in widget instance creations.
# // pedantic
- sort_child_properties_last
# Dart SDK: >= 2.0.0 • (Linter v0.1.11)
# Sort constructor declarations before other members.
#- sort_constructors_first
# Dart SDK: >= 2.0.0 • (Linter v0.1.11)
# Sort unnamed constructor declarations first.
- sort_unnamed_constructors_first
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Place the super call last in a constructor initialization list.
#- super_goes_last (deprecated)
# Dart SDK: >= 2.11.0-182.0.dev • (Linter v0.1.120)
# Tighten type of initializing formal.
#- tighten_type_of_initializing_formals
# Dart SDK: >= 2.0.0 • (Linter v0.1.5)
# PREFER type annotating public APIs.
# // effective_dart
- type_annotate_public_apis
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)
# Don't type annotate initializing formals.
# recommended flutter // pedantic effective_dart
- type_init_formals
# Dart SDK: >= 2.0.0 • (Linter v0.1.19)
# DO await functions that return a Future inside of an async function body.
# // pedantic
- unawaited_futures
# Dart SDK: >= 2.1.1-dev.0.0 • (Linter v0.1.73)
# Unnecessary await keyword in return.
- unnecessary_await_in_return
# Dart SDK: >= 2.0.0 • (Linter v0.1.30)
# Avoid using braces in interpolation when not needed.
# recommended flutter // pednatic effective_dart
#- unnecessary_brace_in_string_interps: false
# Dart SDK: >= 2.0.0 • (Linter v0.1.54)
# AVOID repeating const keyword in a const context.
# recommended flutter // pedantic effective_dart
- unnecessary_const
# (Linter vnull)
# PREFER using the default unnamed Constructor over .new.
#- unnecessary_constructor_name
# Dart SDK: >= 2.7.0 • (Linter v0.1.104)
# Don't use final for local variables.
#- unnecessary_final
# Dart SDK: >= 2.0.0 • (Linter v0.1.1)