Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit bbc47d1

Browse files
committed
chore: add new linter rules
1 parent a264595 commit bbc47d1

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

analysis_options.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ linter:
4343
- avoid_catching_errors
4444
- avoid_classes_with_only_static_members
4545
- avoid_double_and_int_checks
46+
- avoid_dynamic_calls
47+
- avoid_empty_else
4648
- avoid_equals_and_hash_code_on_mutable_classes
4749
- avoid_escaping_inner_quotes
4850
- avoid_field_initializers_in_const_classes
4951
- avoid_function_literals_in_foreach_calls
5052
- avoid_implementing_value_types
5153
- avoid_js_rounded_ints
54+
- avoid_multiple_declarations_per_line
5255
- avoid_positional_boolean_parameters
5356
# - avoid_print
5457
- avoid_private_typedef_functions
@@ -60,6 +63,7 @@ linter:
6063
- avoid_returning_this
6164
- avoid_setters_without_getters
6265
- avoid_slow_async_io
66+
- avoid_type_to_string
6367
- avoid_types_on_closure_parameters
6468
- avoid_unnecessary_containers
6569
- avoid_unused_constructor_parameters
@@ -68,10 +72,12 @@ linter:
6872
- camel_case_types
6973
- cancel_subscriptions
7074
- cascade_invocations
75+
- cast_nullable_to_non_nullable
7176
- close_sinks
7277
- comment_references
7378
- constant_identifier_names
7479
- control_flow_in_finally
80+
- deprecated_consistency
7581
- diagnostic_describe_all_properties
7682
- directives_ordering
7783
- do_not_use_environment
@@ -94,6 +100,7 @@ linter:
94100
- no_logic_in_create_state
95101
- no_runtimeType_toString
96102
- non_constant_identifier_names
103+
- null_check_on_nullable_type_parameter
97104
# - one_member_abstracts
98105
- only_throw_errors
99106
- overridden_fields
@@ -132,21 +139,26 @@ linter:
132139
- sort_unnamed_constructors_first
133140
- test_types_in_equals
134141
- throw_in_finally
142+
- tighten_type_of_initializing_formals
135143
- type_annotate_public_apis
136144
- unnecessary_await_in_return
137145
# - unnecessary_final
138146
- unnecessary_lambdas
139147
- unnecessary_null_aware_assignments
148+
- unnecessary_null_checks
140149
- unnecessary_nullable_for_final_variable_declarations
141150
- unnecessary_overrides
142151
- unnecessary_parenthesis
143152
- unnecessary_raw_strings
144153
- unnecessary_statements
145154
- unnecessary_string_escapes
146155
- unnecessary_string_interpolations
156+
- use_build_context_synchronously
157+
- use_if_null_to_convert_nulls_to_bools
147158
- use_is_even_rather_than_modulo
148159
- use_key_in_widget_constructors
149160
- use_late_for_private_fields_and_variables
161+
- use_named_constants
150162
- use_raw_strings
151163
- use_setters_to_change_properties
152164
- use_string_buffers

lib/src/config_builder/config_builder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ConfigBuilder {
1313
static const _defaultSkippedFolders = [
1414
'ios/',
1515
'.dart_tool/**',
16-
'packages/**'
16+
'packages/**',
1717
];
1818

1919
static Config getConfig(

test/analyzers/lint_analyzer/rules/rules_list/avoid_returning_widgets/avoid_returning_widgets_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void main() {
4545
'Future<Widget> _getWidgetFuture() => Future.value(Container());',
4646
'Widget _getWidget() => Container();',
4747
'@ignoredAnnotation\n'
48-
'Widget _getWidgetWithIgnoredAnnotation() => Container();'
48+
'Widget _getWidgetWithIgnoredAnnotation() => Container();',
4949
],
5050
messages: [
5151
'Avoid returning widgets from a function.',

0 commit comments

Comments
 (0)