Skip to content

Commit 7e592f0

Browse files
committed
chore: improve lints
1 parent 8d46514 commit 7e592f0

File tree

1 file changed

+106
-29
lines changed

1 file changed

+106
-29
lines changed

analysis_options.yaml

+106-29
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,110 @@
11
include: package:flutter_lints/flutter.yaml
22

3+
analyzer:
4+
# would be nice, but requires a lot of manual work:
5+
# language:
6+
# strict-casts: true
7+
# strict-inference: true
8+
# strict-raw-types: true
9+
exclude:
10+
# Ignore generated files
11+
- '**/*.g.dart'
12+
- '**/*.mocks.dart' # Mockito (https://pub.dev/packages/mockito)
13+
314
linter:
415
rules:
5-
always_declare_return_types: true
6-
always_put_required_named_parameters_first: true
7-
annotate_overrides: true
8-
avoid_empty_else: true
9-
avoid_escaping_inner_quotes: true
10-
avoid_print: true
11-
avoid_types_on_closure_parameters: true
12-
avoid_void_async: true
13-
cascade_invocations: true
14-
directives_ordering: true
15-
omit_local_variable_types: true
16-
prefer_const_constructors: true
17-
prefer_const_constructors_in_immutables: true
18-
prefer_const_declarations: true
19-
prefer_final_fields: true
20-
prefer_final_in_for_each: true
21-
prefer_final_locals: true
22-
prefer_initializing_formals: true
23-
prefer_int_literals: true
24-
prefer_interpolation_to_compose_strings: true
25-
prefer_relative_imports: true
26-
prefer_single_quotes: true
27-
sort_constructors_first: true
28-
sort_unnamed_constructors_first: true
29-
unnecessary_lambdas: true
30-
unnecessary_parenthesis: true
31-
unnecessary_string_interpolations: true
32-
avoid_web_libraries_in_flutter: true
33-
conditional_uri_does_not_exist: true
16+
- always_declare_return_types
17+
- avoid_escaping_inner_quotes
18+
- avoid_void_async
19+
- directives_ordering
20+
- avoid_web_libraries_in_flutter
21+
- prefer_const_constructors
22+
- prefer_const_constructors_in_immutables
23+
- prefer_const_declarations
24+
- use_test_throws_matchers
25+
- use_raw_strings
26+
- use_named_constants
27+
- use_late_for_private_fields_and_variables
28+
- use_is_even_rather_than_modulo
29+
- use_if_null_to_convert_nulls_to_bools
30+
- use_enums
31+
- use_colored_box
32+
- unnecessary_this
33+
- unnecessary_statements
34+
- unnecessary_raw_strings
35+
- unnecessary_parenthesis
36+
- unnecessary_null_checks
37+
- unnecessary_null_aware_operator_on_extension_on_nullable
38+
- unnecessary_library_directive
39+
# - unnecessary_breaks # would be nice, but requires a lot of manual work
40+
- unnecessary_await_in_return
41+
- unawaited_futures
42+
- type_annotate_public_apis
43+
- tighten_type_of_initializing_formals
44+
- throw_in_finally
45+
- test_types_in_equals
46+
- sort_unnamed_constructors_first
47+
- sort_constructors_first
48+
- sort_child_properties_last
49+
- slash_for_doc_comments
50+
- sized_box_shrink_expand
51+
# - require_trailing_commas # would be nice, but requires a lot of manual work
52+
- prefer_void_to_null
53+
- prefer_null_aware_method_calls
54+
- prefer_mixin
55+
- prefer_if_elements_to_conditional_expressions
56+
- prefer_foreach
57+
- prefer_final_in_for_each
58+
- prefer_final_locals
59+
- prefer_relative_imports
60+
- prefer_single_quotes
61+
# - prefer_expression_function_bodies # would be nice, but requires a lot of manual work
62+
- prefer_const_literals_to_create_immutables
63+
# - prefer_asserts_with_message # would be nice, but requires a lot of manual work
64+
- prefer_asserts_in_initializer_lists
65+
- parameter_assignments
66+
- only_throw_errors
67+
- noop_primitive_operations
68+
- no_self_assignments
69+
- no_runtimeType_toString
70+
- no_literal_bool_comparisons
71+
- no_default_cases
72+
- no_adjacent_strings_in_list
73+
- missing_whitespace_between_adjacent_strings
74+
- missing_code_block_language_in_doc_comment
75+
- literal_only_boolean_expressions
76+
# - lines_longer_than_80_chars
77+
- library_names
78+
- leading_newlines_in_multiline_strings
79+
- join_return_with_assignment
80+
- invalid_case_patterns
81+
- implicit_reopen
82+
- flutter_style_todos
83+
- file_names
84+
- eol_at_end_of_file
85+
- do_not_use_environment
86+
# - deprecated_consistency
87+
- conditional_uri_does_not_exist
88+
- combinators_ordering
89+
- cast_nullable_to_non_nullable
90+
- cancel_subscriptions
91+
- avoid_unused_constructor_parameters
92+
- avoid_type_to_string
93+
- avoid_slow_async_io
94+
# - avoid_setters_without_getters # would be nice, but requires a lot of manual work
95+
- avoid_redundant_argument_values
96+
# - avoid_positional_boolean_parameters # would be nice, but requires a lot of manual work
97+
- avoid_js_rounded_ints
98+
- avoid_implementing_value_types
99+
- avoid_field_initializers_in_const_classes
100+
- avoid_equals_and_hash_code_on_mutable_classes
101+
- avoid_dynamic_calls
102+
- avoid_double_and_int_checks
103+
- avoid_catching_errors
104+
# - avoid_catches_without_on_clauses # would be nice, but requires a lot of manual work
105+
- avoid_bool_literals_in_conditional_expressions
106+
- always_put_control_body_on_new_line
107+
- always_put_required_named_parameters_first
108+
- avoid_types_on_closure_parameters
109+
- omit_local_variable_types
110+
- prefer_int_literals

0 commit comments

Comments
 (0)