Skip to content

Commit 217f21e

Browse files
authored
Enable and fix new lints (#1274)
1 parent bccf4b3 commit 217f21e

32 files changed

+50
-3
lines changed

_test_yaml/test/ensure_build_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
@TestOn('vm')
66
@Tags(['presubmit-only'])
7+
library test;
8+
79
import 'package:build_verify/build_verify.dart';
810
import 'package:test/test.dart';
911

_test_yaml/test/yaml_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@TestOn('vm')
6+
library test;
7+
68
import 'dart:io';
79

810
import 'package:_json_serial_shared_test/shared_test.dart';

analysis_options.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ linter:
1616
- avoid_void_async
1717
- cancel_subscriptions
1818
- cascade_invocations
19+
- collection_methods_unrelated_type
20+
- combinators_ordering
1921
- comment_references
22+
- dangling_library_doc_comments
2023
- directives_ordering
24+
- implicit_call_tearoffs
2125
- join_return_with_assignment
26+
- library_annotations
2227
- lines_longer_than_80_chars
2328
- literal_only_boolean_expressions
2429
- missing_whitespace_between_adjacent_strings
@@ -40,10 +45,13 @@ linter:
4045
- type_annotate_public_apis
4146
- unawaited_futures
4247
- unnecessary_lambdas
48+
- unnecessary_library_directive
4349
- unnecessary_parenthesis
4450
- unnecessary_statements
51+
- unreachable_from_main
4552
- unsafe_html
4653
- use_full_hex_values_for_flutter_colors
4754
- use_is_even_rather_than_modulo
4855
- use_string_buffers
56+
- use_string_in_part_of_directives
4957
- use_super_parameters

checked_yaml/test/ensure_build_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
@TestOn('vm')
66
@Tags(['presubmit-only'])
7+
library test;
8+
79
import 'package:build_verify/build_verify.dart';
810
import 'package:test/test.dart';
911

example/test/ensure_build_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@Tags(['presubmit-only'])
6+
library test;
7+
68
import 'package:build_verify/build_verify.dart';
79
import 'package:test/test.dart';
810

json_serializable/lib/type_helper.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
export 'src/shared_checkers.dart' show simpleJsonTypeChecker;
66
export 'src/type_helper.dart'
7-
show TypeHelperContext, TypeHelperContextWithConfig, TypeHelper;
7+
show TypeHelper, TypeHelperContext, TypeHelperContextWithConfig;
88
export 'src/type_helpers/big_int_helper.dart';
99
export 'src/type_helpers/config_types.dart';
1010
export 'src/type_helpers/convert_helper.dart';

json_serializable/test/annotation_version_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
@TestOn('vm')
66
@Tags(['presubmit-only'])
7+
library test;
8+
79
import 'dart:io';
810

911
import 'package:json_serializable/src/check_dependencies.dart';

json_serializable/test/config_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@TestOn('vm')
6+
library test;
7+
68
import 'dart:io';
79

810
import 'package:build/build.dart';

json_serializable/test/custom_configuration_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@TestOn('vm')
6+
library test;
7+
68
import 'dart:async';
79

810
import 'package:analyzer/dart/element/type.dart';

json_serializable/test/default_value/default_value.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import 'package:json_annotation/json_annotation.dart';
99
import 'default_value_interface.dart' as dvi hide Greek;
1010
import 'default_value_interface.dart'
1111
show
12-
Greek,
1312
ConstClass,
1413
ConstClassConverter,
14+
Greek,
1515
constClassFromJson,
1616
constClassToJson,
1717
intDefaultValueFunction;

json_serializable/test/default_value/default_value.g_any_map__checked.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import 'package:json_annotation/json_annotation.dart';
99
import 'default_value_interface.dart' as dvi hide Greek;
1010
import 'default_value_interface.dart'
1111
show
12-
Greek,
1312
ConstClass,
1413
ConstClassConverter,
14+
Greek,
1515
constClassFromJson,
1616
constClassToJson,
1717
intDefaultValueFunction;

json_serializable/test/ensure_build_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
@TestOn('vm')
66
@Tags(['presubmit-only'])
7+
library test;
8+
79
import 'package:build_verify/build_verify.dart';
810
import 'package:test/test.dart';
911

json_serializable/test/enum_helper_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@TestOn('vm')
6+
library test;
7+
68
import 'package:json_serializable/src/type_helpers/enum_helper.dart';
79
import 'package:test/test.dart';
810

json_serializable/test/json_serializable_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@TestOn('vm')
6+
library test;
7+
68
import 'package:json_serializable/json_serializable.dart';
79
import 'package:path/path.dart' as p;
810
import 'package:source_gen_test/source_gen_test.dart';

json_serializable/test/literal/json_literal_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@TestOn('vm')
6+
library test;
7+
68
import 'dart:convert';
79
import 'dart:io';
810

json_serializable/test/supported_types/extra_map_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.bigint_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.bool_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.datetime_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.double_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.duration_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.enumtype_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.int_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.iterable_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.list_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.map_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.num_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.object_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.set_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.string_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

json_serializable/test/supported_types/type_test.uri_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: prefer_const_declarations
66
@TestOn('vm')
7+
library test;
78

89
import 'dart:convert';
910

0 commit comments

Comments
 (0)