Skip to content

Commit eece4c9

Browse files
authored
Enable and fix lint prefer_collection_literals (#310)
Requires bumping the SDK to use set literals. This also fixes some annoyances with the analyzer in older SDK versions.
1 parent 1ad2a56 commit eece4c9

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: dart
22

33
dart:
44
- dev
5-
- 2.0.0
5+
- 2.2.0
66

77
dart_task:
88
- test: --platform vm

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ linter:
4848
- prefer_contains
4949
- prefer_equal_for_default_values
5050
- prefer_final_fields
51+
- prefer_collection_literals
5152
- prefer_generic_function_type_aliases
5253
- prefer_initializing_formals
5354
- prefer_is_empty

lib/src/browser_client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class BrowserClient extends BaseClient {
2929
/// The currently active XHRs.
3030
///
3131
/// These are aborted if the client is closed.
32-
final _xhrs = Set<HttpRequest>();
32+
final _xhrs = <HttpRequest>{};
3333

3434
/// Creates a new HTTP client.
3535
BrowserClient();

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ homepage: https://github.com/dart-lang/http
55
description: A composable, multi-platform, Future-based API for HTTP requests.
66

77
environment:
8-
sdk: ">=2.0.0 <3.0.0"
8+
sdk: ">=2.2.0 <3.0.0"
99

1010
dependencies:
1111
async: ">=1.10.0 <3.0.0"

0 commit comments

Comments
 (0)