Skip to content

Commit 7706f67

Browse files
committed
Enable and fix a few more lints
1 parent 30cb981 commit 7706f67

File tree

5 files changed

+67
-62
lines changed

5 files changed

+67
-62
lines changed

pkgs/typed_data/analysis_options.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@ analyzer:
66

77
linter:
88
rules:
9+
- avoid_dynamic_calls
10+
- always_declare_return_types
911
- avoid_returning_null
1012
- avoid_unused_constructor_parameters
1113
- cancel_subscriptions
1214
- comment_references
1315
- directives_ordering
1416
- invariant_booleans
1517
- no_adjacent_strings_in_list
18+
- omit_local_variable_types
1619
- only_throw_errors
1720
- package_api_docs
1821
- prefer_const_constructors
1922
- prefer_interpolation_to_compose_strings
23+
- prefer_single_quotes
2024
- test_types_in_equals
2125
- throw_in_finally
26+
- unawaited_futures
2227
- unnecessary_lambdas
2328
- unnecessary_null_aware_assignments
2429
- unnecessary_statements

pkgs/typed_data/lib/src/typed_queue.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import "dart:collection";
6-
import "dart:typed_data";
5+
import 'dart:collection';
6+
import 'dart:typed_data';
77

8-
import "package:collection/collection.dart";
8+
import 'package:collection/collection.dart';
99

1010
import 'typed_buffer.dart';
1111

@@ -41,7 +41,7 @@ abstract class _TypedQueue<E, L extends List<E>> with ListMixin<E> {
4141
@override
4242
QueueList<T> cast<T>() {
4343
if (this is QueueList<T>) return this as QueueList<T>;
44-
throw UnsupportedError("$this cannot be cast to the desired type.");
44+
throw UnsupportedError('$this cannot be cast to the desired type.');
4545
}
4646

4747
@Deprecated('Use `cast` instead')
@@ -62,15 +62,15 @@ abstract class _TypedQueue<E, L extends List<E>> with ListMixin<E> {
6262
}
6363

6464
E removeFirst() {
65-
if (_head == _tail) throw StateError("No element");
65+
if (_head == _tail) throw StateError('No element');
6666
var result = _table[_head];
6767
_head = (_head + 1) & (_table.length - 1);
6868
return result;
6969
}
7070

7171
@override
7272
E removeLast() {
73-
if (_head == _tail) throw StateError("No element");
73+
if (_head == _tail) throw StateError('No element');
7474
_tail = (_tail - 1) & (_table.length - 1);
7575
return _table[_tail];
7676
}
@@ -82,7 +82,7 @@ abstract class _TypedQueue<E, L extends List<E>> with ListMixin<E> {
8282

8383
@override
8484
set length(int value) {
85-
RangeError.checkNotNegative(value, "length");
85+
RangeError.checkNotNegative(value, 'length');
8686

8787
var delta = value - length;
8888
if (delta >= 0) {

pkgs/typed_data/lib/typed_data.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
/// Utilities and functionality related to the "dart:typed_data" library.
66
library typed_data;
77

8-
export "src/typed_queue.dart";
9-
export "typed_buffers.dart";
8+
export 'src/typed_queue.dart';
9+
export 'typed_buffers.dart';

0 commit comments

Comments
 (0)