Skip to content

Commit fcd259f

Browse files
authored
Merge pull request #155 from yumemi-inc/auto/update-lint-rules-e13b397
Update lint rules
2 parents e13b397 + b2e6ece commit fcd259f

File tree

4 files changed

+444
-0
lines changed

4 files changed

+444
-0
lines changed
+222
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
# GENERATED CODE - DO NOT MODIFY BY HAND
2+
3+
linter:
4+
rules:
5+
- always_declare_return_types # categories: style
6+
- always_put_control_body_on_new_line # categories: errorProne,style
7+
- always_put_required_named_parameters_first # categories: style
8+
- always_specify_types # incompatibles: avoid_types_on_closure_parameters,omit_local_variable_types,omit_obvious_local_variable_types,omit_obvious_property_types # categories: style
9+
- always_use_package_imports # incompatibles: prefer_relative_imports # categories: errorProne
10+
- annotate_overrides # categories: style
11+
- annotate_redeclares # categories: style
12+
- avoid_annotating_with_dynamic # categories: brevity,style
13+
- avoid_bool_literals_in_conditional_expressions # categories: brevity
14+
- avoid_catches_without_on_clauses # categories: effectiveDart,style
15+
- avoid_catching_errors # categories: style
16+
- avoid_classes_with_only_static_members # categories: effectiveDart,languageFeatureUsage,style
17+
- avoid_double_and_int_checks # categories: errorProne,web
18+
- avoid_dynamic_calls # categories: binarySize,errorProne
19+
- avoid_empty_else # categories: brevity,errorProne
20+
- avoid_equals_and_hash_code_on_mutable_classes # categories: effectiveDart,style
21+
- avoid_escaping_inner_quotes # categories: style
22+
- avoid_field_initializers_in_const_classes # categories: style
23+
- avoid_final_parameters # incompatibles: prefer_final_parameters # categories: style
24+
- avoid_function_literals_in_foreach_calls # categories: style
25+
- avoid_futureor_void # categories: errorProne,unintentional
26+
- avoid_implementing_value_types # categories: style
27+
- avoid_init_to_null # categories: brevity,effectiveDart,style
28+
- avoid_js_rounded_ints # categories: errorProne,web
29+
- avoid_multiple_declarations_per_line # categories: style
30+
- avoid_null_checks_in_equality_operators # categories: style
31+
- avoid_positional_boolean_parameters # categories: effectiveDart,style
32+
- avoid_print # categories: unintentional
33+
- avoid_private_typedef_functions # categories: style
34+
- avoid_redundant_argument_values # categories: brevity,style
35+
- avoid_relative_lib_imports # categories: errorProne
36+
- avoid_renaming_method_parameters # categories: documentationCommentMaintenance
37+
- avoid_return_types_on_setters # categories: brevity,style
38+
- avoid_returning_null_for_void # categories: style
39+
- avoid_returning_this # categories: effectiveDart,style
40+
- avoid_setters_without_getters # categories: style
41+
- avoid_shadowing_type_parameters # categories: errorProne
42+
- avoid_single_cascade_in_expression_statements # categories: brevity,style
43+
- avoid_slow_async_io # categories: nonPerformant
44+
- avoid_type_to_string # categories: unintentional
45+
- avoid_types_as_parameter_names # categories: unintentional
46+
- avoid_types_on_closure_parameters # incompatibles: always_specify_types # categories: style
47+
- avoid_unused_constructor_parameters # categories: unintentional
48+
- avoid_void_async # categories: style
49+
- await_only_futures # categories: style
50+
- camel_case_extensions # categories: effectiveDart,style
51+
- camel_case_types # categories: effectiveDart,style
52+
- cancel_subscriptions # categories: errorProne,memoryLeaks
53+
- cascade_invocations # categories: brevity,languageFeatureUsage,style
54+
- cast_nullable_to_non_nullable # categories: errorProne
55+
- close_sinks # categories: errorProne,memoryLeaks
56+
- collection_methods_unrelated_type # categories: unintentional
57+
- combinators_ordering # categories: style
58+
- comment_references # categories: documentationCommentMaintenance
59+
- conditional_uri_does_not_exist # categories: errorProne
60+
- constant_identifier_names # categories: style
61+
- control_flow_in_finally # categories: errorProne
62+
- curly_braces_in_flow_control_structures # categories: errorProne
63+
- dangling_library_doc_comments # categories: documentationCommentMaintenance
64+
- depend_on_referenced_packages # categories: pub
65+
- deprecated_consistency # categories: style
66+
- deprecated_member_use_from_same_package # categories: languageFeatureUsage
67+
- directives_ordering # categories: style
68+
- discarded_futures # categories: errorProne
69+
- do_not_use_environment # categories: errorProne
70+
- document_ignores # categories: style
71+
- empty_catches # categories: style
72+
- empty_constructor_bodies # categories: brevity,effectiveDart,style
73+
- empty_statements # categories: errorProne
74+
- eol_at_end_of_file # categories: style
75+
- exhaustive_cases # categories: errorProne
76+
- file_names # categories: style
77+
- flutter_style_todos # categories: style
78+
- hash_and_equals # categories: errorProne
79+
- implementation_imports # categories: style
80+
- implicit_call_tearoffs # categories: style
81+
- implicit_reopen # categories: errorProne
82+
- invalid_case_patterns # categories: languageFeatureUsage
83+
- invalid_runtime_check_with_js_interop_types # categories: errorProne,web
84+
- join_return_with_assignment # categories: brevity,style
85+
- leading_newlines_in_multiline_strings # categories: style
86+
- library_annotations # categories: style
87+
- library_names # categories: style
88+
- library_prefixes # categories: style
89+
- library_private_types_in_public_api # categories: publicInterface
90+
- lines_longer_than_80_chars # categories: style
91+
- literal_only_boolean_expressions # categories: unusedCode
92+
- matching_super_parameters # categories: style
93+
- missing_code_block_language_in_doc_comment # categories: errorProne
94+
- missing_whitespace_between_adjacent_strings # categories: errorProne
95+
- no_adjacent_strings_in_list # categories: style
96+
- no_default_cases # categories: style
97+
- no_duplicate_case_values # categories: errorProne
98+
- no_leading_underscores_for_library_prefixes # categories: style
99+
- no_leading_underscores_for_local_identifiers # categories: style
100+
- no_literal_bool_comparisons # categories: effectiveDart,style
101+
- no_runtimeType_toString # categories: nonPerformant
102+
- no_self_assignments # categories: unintentional
103+
- no_wildcard_variable_uses # categories: languageFeatureUsage,unintentional
104+
- non_constant_identifier_names # categories: style
105+
- noop_primitive_operations # categories: style
106+
- null_check_on_nullable_type_parameter # categories: style
107+
- null_closures # categories: errorProne
108+
- omit_local_variable_types # incompatibles: always_specify_types,specify_nonobvious_local_variable_types # categories: style
109+
- omit_obvious_local_variable_types # incompatibles: always_specify_types # categories: style
110+
- omit_obvious_property_types # incompatibles: always_specify_types # categories: style
111+
- one_member_abstracts # categories: effectiveDart,languageFeatureUsage,style
112+
- only_throw_errors # categories: style
113+
- overridden_fields # categories: style
114+
- package_names # categories: style
115+
- package_prefixed_library_names # categories: style
116+
- parameter_assignments # categories: style
117+
- prefer_adjacent_string_concatenation # categories: style
118+
- prefer_asserts_in_initializer_lists # categories: style
119+
- prefer_asserts_with_message # categories: style
120+
- prefer_collection_literals # categories: brevity,style
121+
- prefer_conditional_assignment # categories: brevity,style
122+
- prefer_const_constructors # categories: style
123+
- prefer_const_constructors_in_immutables # categories: style
124+
- prefer_const_declarations # categories: style
125+
- prefer_const_literals_to_create_immutables # categories: style
126+
- prefer_constructors_over_static_methods # categories: style
127+
- prefer_contains # categories: style
128+
- prefer_double_quotes # incompatibles: prefer_single_quotes # categories: style
129+
- prefer_expression_function_bodies # categories: brevity,style
130+
- prefer_final_fields # categories: effectiveDart,style
131+
- prefer_final_in_for_each # incompatibles: unnecessary_final # categories: style
132+
- prefer_final_locals # incompatibles: unnecessary_final # categories: style
133+
- prefer_final_parameters # incompatibles: unnecessary_final,avoid_final_parameters # categories: style
134+
- prefer_for_elements_to_map_fromIterable # categories: brevity,style
135+
- prefer_foreach # categories: style
136+
- prefer_function_declarations_over_variables # categories: effectiveDart,style
137+
- prefer_generic_function_type_aliases # categories: style
138+
- prefer_if_elements_to_conditional_expressions # categories: brevity,style
139+
- prefer_if_null_operators # categories: brevity,style
140+
- prefer_initializing_formals # categories: brevity,style
141+
- prefer_inlined_adds # categories: brevity,style
142+
- prefer_int_literals # categories: style
143+
- prefer_interpolation_to_compose_strings # categories: style
144+
- prefer_is_empty # categories: errorProne
145+
- prefer_is_not_empty # categories: style
146+
- prefer_is_not_operator # categories: brevity,style
147+
- prefer_iterable_whereType # categories: style
148+
- prefer_mixin # categories: languageFeatureUsage,style
149+
- prefer_null_aware_method_calls # categories: brevity,style
150+
- prefer_null_aware_operators # categories: brevity,style
151+
- prefer_relative_imports # incompatibles: always_use_package_imports # categories: errorProne
152+
- prefer_single_quotes # incompatibles: prefer_double_quotes # categories: style
153+
- prefer_spread_collections # categories: brevity,style
154+
- prefer_typing_uninitialized_variables # categories: errorProne,unintentional
155+
- prefer_void_to_null # categories: errorProne
156+
- provide_deprecation_message # categories: publicInterface
157+
- public_member_api_docs # categories: publicInterface,style
158+
- recursive_getters # categories: errorProne,unintentional
159+
- require_trailing_commas # categories: style
160+
- secure_pubspec_urls # categories: pub
161+
- slash_for_doc_comments # categories: effectiveDart,style
162+
- sort_constructors_first # categories: style
163+
- sort_pub_dependencies # categories: pub
164+
- sort_unnamed_constructors_first # categories: style
165+
- specify_nonobvious_local_variable_types # incompatibles: omit_local_variable_types # categories: style
166+
- specify_nonobvious_property_types # categories: style
167+
- strict_top_level_inference # categories: style
168+
- test_types_in_equals # categories: errorProne
169+
- throw_in_finally # categories: errorProne
170+
- tighten_type_of_initializing_formals # categories: style
171+
- type_annotate_public_apis # categories: effectiveDart,publicInterface
172+
- type_init_formals # categories: effectiveDart,style
173+
- type_literal_in_constant_pattern # categories: style
174+
- unawaited_futures # categories: style
175+
- unintended_html_in_doc_comment # categories: errorProne
176+
- unnecessary_async # categories: style
177+
- unnecessary_await_in_return # categories: style
178+
- unnecessary_brace_in_string_interps # categories: brevity,style
179+
- unnecessary_breaks # categories: brevity,style
180+
- unnecessary_const # categories: brevity,style
181+
- unnecessary_constructor_name # categories: brevity,style
182+
- unnecessary_final # incompatibles: prefer_final_locals,prefer_final_parameters,prefer_final_in_for_each # categories: effectiveDart,style
183+
- unnecessary_getters_setters # categories: effectiveDart,style
184+
- unnecessary_lambdas # categories: style
185+
- unnecessary_late # categories: style
186+
- unnecessary_library_directive # categories: brevity
187+
- unnecessary_library_name # categories: brevity,languageFeatureUsage,style
188+
- unnecessary_new # categories: brevity,languageFeatureUsage,style
189+
- unnecessary_null_aware_assignments # categories: brevity,effectiveDart,style
190+
- unnecessary_null_aware_operator_on_extension_on_nullable # categories: style
191+
- unnecessary_null_checks # categories: brevity,style
192+
- unnecessary_null_in_if_null_operators # categories: style
193+
- unnecessary_nullable_for_final_variable_declarations # categories: style
194+
- unnecessary_overrides # categories: style
195+
- unnecessary_parenthesis # categories: brevity,style
196+
- unnecessary_raw_strings # categories: brevity,style
197+
- unnecessary_statements # categories: brevity,unintentional
198+
- unnecessary_string_escapes # categories: brevity,style
199+
- unnecessary_string_interpolations # categories: brevity,style
200+
- unnecessary_this # categories: brevity,effectiveDart,style
201+
- unnecessary_to_list_in_spreads # categories: brevity
202+
- unnecessary_underscores # categories: brevity,style
203+
- unreachable_from_main # categories: unusedCode
204+
- unrelated_type_equality_checks # categories: unintentional
205+
- unsafe_variance # categories: errorProne
206+
- use_enums # categories: style
207+
- use_function_type_syntax_for_parameters # categories: style
208+
- use_if_null_to_convert_nulls_to_bools # categories: effectiveDart,style
209+
- use_is_even_rather_than_modulo # categories: style
210+
- use_late_for_private_fields_and_variables # categories: style
211+
- use_named_constants # categories: style
212+
- use_raw_strings # categories: style
213+
- use_rethrow_when_possible # categories: brevity,effectiveDart
214+
- use_setters_to_change_properties # categories: style
215+
- use_string_buffers # categories: nonPerformant
216+
- use_string_in_part_of_directives # categories: effectiveDart,style
217+
- use_super_parameters # categories: brevity
218+
- use_test_throws_matchers # categories: style
219+
- use_to_and_as_if_applicable # categories: effectiveDart,style
220+
- use_truncating_division # categories: languageFeatureUsage
221+
- valid_regexps # categories: unintentional
222+
- void_checks # categories: style
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# GENERATED CODE - DO NOT MODIFY BY HAND
2+
3+
include: package:yumemi_lints/dart/3.7/all.yaml
4+
5+
analyzer:
6+
language:
7+
# Increase safety as much as possible.
8+
strict-casts: true
9+
strict-inference: true
10+
strict-raw-types: true
11+
errors:
12+
# By including all.yaml, some rules will conflict. These warnings will be addressed within this file.
13+
included_file_warning: ignore
14+
15+
# Members annotated with `visibleForTesting` should not be referenced outside of the library in which they are declared or libraries within the test directory.
16+
invalid_use_of_visible_for_testing_member: error
17+
18+
# Superclass members should not be unintentionally overridden, as this reduces readability.
19+
annotate_overrides: error
20+
21+
# Class members should not be unintentionally redeclared, as this reduces readability.
22+
annotate_redeclares: error
23+
24+
# When using implements, you do not inherit the method body of `==`, making it nearly impossible to follow the contract of `==`.
25+
avoid_implementing_value_types: error
26+
27+
# Parameter names in overridden methods that do not match the original method's parameter names are usually considered typos.
28+
avoid_renaming_method_parameters: error
29+
30+
# Shadowing type parameters should not be used, as this reduces readability.
31+
avoid_shadowing_type_parameters: error
32+
33+
# Should not reference files that do not exist for conditional imports, as this will result in possible runtime failures.
34+
conditional_uri_does_not_exist: error
35+
36+
# When importing a package, add it as a dependency in pubspec to impose constraints on the dependency, protecting against breaking changes.
37+
depend_on_referenced_packages: error
38+
39+
# Some file systems are not case-sensitive, so many projects require filenames to be all lowercase.
40+
file_names: error
41+
42+
# Files in the package's lib/src directory are not public APIs and should not be imported.
43+
implementation_imports: error
44+
45+
# Some file systems are not case-sensitive, so many projects require filenames to be all lowercase.
46+
library_names: error
47+
48+
# Super parameter names that do not match the parameter name of the corresponding super constructor are usually considered typos.
49+
matching_super_parameters: error
50+
51+
# When unwrapping to a generic type parameter T, using `x!` can lead to a runtime error if T is given a nullable type, so you should use `x as T` instead.
52+
null_check_on_nullable_type_parameter: error
53+
54+
# If package names are not determined according to the rules, unexpected problems may occur.
55+
package_names: error
56+
57+
# Recursive getters are usually considered typos.
58+
recursive_getters: error
59+
60+
# Should not be assigned to `void`.
61+
void_checks: error
62+
63+
linter:
64+
rules:
65+
# Conflicts with enabling `avoid_types_on_closure_parameters`, `omit_local_variable_types`, `omit_obvious_local_variable_types`, `omit_obvious_property_types`.
66+
always_specify_types: false
67+
68+
# Conflicts with enabling `strict-raw-types`.
69+
avoid_annotating_with_dynamic: false
70+
71+
# There are cases that are warned but not fixed by `dart fix`.
72+
cascade_invocations: false
73+
74+
# Don't use Flutter-style todos.
75+
flutter_style_todos: false
76+
77+
# May add more methods later.
78+
one_member_abstracts: false
79+
80+
# Conflicts with enabling `prefer_single_quotes`.
81+
prefer_double_quotes: false
82+
83+
# Using `=>` has sometimes to reduce readability.
84+
prefer_expression_function_bodies: false
85+
86+
# Conflicts with enabling `avoid_final_parameters`.
87+
prefer_final_parameters: false
88+
89+
# Conflicts with enabling `always_use_package_imports`.
90+
prefer_relative_imports: false
91+
92+
# Don't often develop package.
93+
public_member_api_docs: false
94+
95+
# Conflicts with enabling `omit_local_variable_types`.
96+
specify_nonobvious_local_variable_types: false
97+
98+
# Conflicts with enabling `prefer_final_locals`.
99+
unnecessary_final: false
100+
101+
# Don't trigger warnings with methods for simple state updates, among other things.
102+
use_setters_to_change_properties: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# GENERATED CODE - DO NOT MODIFY BY HAND
2+
3+
include: package:yumemi_lints/dart/3.7/all.yaml
4+
5+
linter:
6+
rules:
7+
- avoid_unnecessary_containers # categories: flutter,style
8+
- avoid_web_libraries_in_flutter # categories: errorProne,flutter,web
9+
- diagnostic_describe_all_properties # categories: errorProne,flutter
10+
- no_logic_in_create_state # categories: errorProne,flutter
11+
- sized_box_for_whitespace # categories: flutter,style
12+
- sized_box_shrink_expand # categories: flutter,style
13+
- sort_child_properties_last # categories: flutter,style
14+
- use_build_context_synchronously # categories: errorProne,flutter
15+
- use_colored_box # categories: flutter,style
16+
- use_decorated_box # categories: flutter,style
17+
- use_full_hex_values_for_flutter_colors # categories: flutter,style
18+
- use_key_in_widget_constructors # categories: flutter,style

0 commit comments

Comments
 (0)