Skip to content

Commit 15aeb4c

Browse files
committed
enable and fix some lints
1 parent 8525ee5 commit 15aeb4c

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

analysis_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ linter:
3737
- implementation_imports
3838
- invariant_booleans
3939
- iterable_contains_unrelated_type
40+
- join_return_with_assignment
4041
- library_names
4142
- library_prefixes
4243
- list_remove_unrelated_type
@@ -69,6 +70,7 @@ linter:
6970
- prefer_typing_uninitialized_variables
7071
- recursive_getters
7172
- slash_for_doc_comments
73+
- sort_pub_dependencies
7274
- test_types_in_equals
7375
- throw_in_finally
7476
- type_init_formals
@@ -79,6 +81,7 @@ linter:
7981
- unnecessary_lambdas
8082
- unnecessary_new
8183
- unnecessary_null_aware_assignments
84+
- unnecessary_parenthesis
8285
- unnecessary_statements
8386
- unnecessary_this
8487
- unrelated_type_equality_checks

json_serializable/lib/src/json_key_utils.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ JsonKey _populateJsonKey(
163163
includeIfNull = false;
164164
}
165165

166-
final jsonKey = JsonKey(
166+
return JsonKey(
167167
defaultValue: defaultValue,
168168
disallowNullValue: disallowNullValue ?? false,
169169
ignore: ignore ?? false,
@@ -174,8 +174,6 @@ JsonKey _populateJsonKey(
174174
required: required ?? false,
175175
encodeEmptyCollection: encodeEmptyCollection,
176176
);
177-
178-
return jsonKey;
179177
}
180178

181179
String _encodedFieldName(JsonSerializable classAnnotation,

json_serializable/test/config_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void main() {
115115
: "type 'int' is not a subtype of type 'bool' in type cast";
116116

117117
final matcher = isA<StateError>().having(
118-
((v) => v.message),
118+
(v) => v.message,
119119
'message',
120120
'''
121121
Could not parse the options provided for `json_serializable`.

json_serializable/tool/test_builder.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,6 @@ class _Replacement {
279279
}
280280
}
281281

282-
outputContent = outputContent.replaceAll(',)', ',\n)');
283-
284-
return outputContent;
282+
return outputContent.replaceAll(',)', ',\n)');
285283
}
286284
}

0 commit comments

Comments
 (0)