Skip to content

Commit 565851c

Browse files
committed
Upgrade lints
1 parent 1f7e61b commit 565851c

File tree

10 files changed

+13
-22
lines changed

10 files changed

+13
-22
lines changed

sqlite3/lib/common.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// Exports common interfaces that are implemented by both the `dart:ffi` and
22
/// the `dart:js` WASM version of this library.
3-
library sqlite3.common;
3+
library;
44

55
export 'src/constants.dart';
66
export 'src/database.dart';

sqlite3/lib/open.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// Utils to open a [DynamicLibrary] on platforms that aren't supported by
22
/// default.
3-
library open;
3+
library;
44

55
import 'dart:ffi';
66

sqlite3/lib/sqlite3.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// Dart bindings to `sqlite3`.
2-
library sqlite3;
2+
library;
33

44
// Hide common base classes that have more specific ffi-APIs.
55
export 'common.dart' hide CommonPreparedStatement, CommonDatabase;

sqlite3/lib/src/ffi/bindings.dart

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,10 @@ final class FfiDatabase extends RawSqliteDatabase {
299299

300300
static Pointer<NativeFunction<Void Function(Pointer<Void>)>> _xDestroy(
301301
List<NativeCallable> callables) {
302-
int destroy(Pointer<Void> _) {
302+
void destroy(Pointer<Void> _) {
303303
for (final callable in callables) {
304304
callable.close();
305305
}
306-
307-
// TODO: Remove and change to void after Dart 3.5 or https://github.com/dart-lang/sdk/issues/56064
308-
return 0;
309306
}
310307

311308
final callable =
@@ -715,8 +712,6 @@ extension on RawXFunc {
715712
return NativeCallable.isolateLocal((Pointer<sqlite3_context> ctx, int nArgs,
716713
Pointer<Pointer<sqlite3_value>> args) {
717714
this(FfiContext(bindings, ctx), _ValueList(nArgs, args, bindings));
718-
// TODO: Remove and change to void after Dart 3.5 or https://github.com/dart-lang/sdk/issues/56064
719-
return 0;
720715
})
721716
..keepIsolateAlive = false;
722717
}
@@ -728,8 +723,6 @@ extension on RawXFinal {
728723
final context = FfiContext(bindings, ctx);
729724
this(context);
730725
if (clean) context.freeContext();
731-
// TODO: Remove and change to void after Dart 3.5 or https://github.com/dart-lang/sdk/issues/56064
732-
return 0;
733726
})
734727
..keepIsolateAlive = false;
735728
}
@@ -762,9 +755,6 @@ extension on RawUpdateHook {
762755
Pointer<sqlite3_char> table, int rowid) {
763756
final tableName = table.readString();
764757
this(kind, tableName, rowid);
765-
766-
// TODO: Remove and change to void after Dart 3.5 or https://github.com/dart-lang/sdk/issues/56064
767-
return 0;
768758
},
769759
)..keepIsolateAlive = false;
770760
}

sqlite3/lib/src/implementation/bindings.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@internal
2-
library sqlite3.implementation.bindings;
2+
library;
33

44
import 'dart:typed_data';
55

sqlite3/lib/src/wasm/vfs/indexed_db.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ class AsynchronousIndexedDbFileSystem {
189189
while (await iterator.moveNext()) {
190190
final row = iterator.current;
191191

192-
final rowOffset = (row.key! as List)[1] as int;
192+
final key = (row.key as JSArray).toDart;
193+
final rowOffset = (key[1] as JSNumber).toDartInt;
193194
final blob = row.value as web.Blob;
194195
final dataLength = min(blob.size, file.length - rowOffset);
195196

sqlite3/lib/wasm.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/// As long as this library is marked as experimental, it is not subject to
1313
/// semantic versioning.
1414
@experimental
15-
library sqlite3.wasm;
15+
library;
1616

1717
import 'package:meta/meta.dart';
1818

sqlite3/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ homepage: https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3
55
issue_tracker: https://github.com/simolus3/sqlite3.dart/issues
66

77
environment:
8-
sdk: '>=3.4.0 <4.0.0'
8+
sdk: '>=3.5.0 <4.0.0'
99

1010
# This package supports all platforms listed below.
1111
platforms:
@@ -36,7 +36,7 @@ dev_dependencies:
3636
build_web_compilers: ^4.0.3
3737
ffigen: ^13.0.0
3838
http: ^1.2.1
39-
lints: ^4.0.0
39+
lints: ^5.0.0
4040
shelf: ^1.4.0
4141
shelf_proxy: ^1.0.2
4242
shelf_static: ^1.1.0

sqlite3_web/lib/src/client.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ final class RemoteDatabase implements Database {
9898
@override
9999
Future<int> get lastInsertRowId async {
100100
final result = await select('select last_insert_rowid();');
101-
return result.single[0] as int;
101+
return result.single.columnAt(0) as int;
102102
}
103103

104104
@override
@@ -129,7 +129,7 @@ final class RemoteDatabase implements Database {
129129
@override
130130
Future<int> get userVersion async {
131131
final result = await select('pragma user_version;');
132-
return result.single[0] as int;
132+
return result.single.columnAt(0) as int;
133133
}
134134

135135
@override

sqlite3_web/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
web: ^1.0.0
1414

1515
dev_dependencies:
16-
lints: ^2.1.0
16+
lints: ^5.0.0
1717
test: ^1.25.5
1818
build_web_compilers: ^4.0.9
1919
build_runner: ^2.4.8

0 commit comments

Comments
 (0)