Skip to content

Commit 9f786f4

Browse files
authored
Fix analysis issues (#2294)
1 parent b0271a5 commit 9f786f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+55
-20
lines changed

analysis/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ homepage: https://github.com/sass/dart-sass/tree/master/analysis
66
publish_to: none
77

88
environment:
9-
sdk: ">=2.17.0 <3.0.0"
9+
sdk: ">=3.0.0 <4.0.0"
1010

1111
dependencies:
12-
lints: ^2.0.0
12+
lints: ^4.0.0

lib/src/async_import_cache.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,7 @@ final class AsyncImportCache {
318318
// If multiple original URLs canonicalize to the same thing, choose the
319319
// shortest one.
320320
minBy<Uri, int>(
321-
_canonicalizeCache.values
322-
.whereNotNull()
321+
_canonicalizeCache.values.nonNulls
323322
.where((result) => result.$2 == canonicalUrl)
324323
.map((result) => result.originalUrl),
325324
(url) => url.path.length)

lib/src/extend/functions.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,4 +916,4 @@ Iterable<SelectorList> _selectorPseudoArgs(
916916
.whereType<PseudoSelector>()
917917
.where((pseudo) => pseudo.isClass == isClass && pseudo.name == name)
918918
.map((pseudo) => pseudo.selector)
919-
.whereNotNull();
919+
.nonNulls;

lib/src/import_cache.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// DO NOT EDIT. This file was generated from async_import_cache.dart.
66
// See tool/grind/synchronize.dart for details.
77
//
8-
// Checksum: 4362e28e5cd425786c235d2a6a2bb60539403799
8+
// Checksum: f70eea612e1613ef93bad353803ad9479cda04aa
99
//
1010
// ignore_for_file: unused_import
1111

@@ -313,8 +313,7 @@ final class ImportCache {
313313
// If multiple original URLs canonicalize to the same thing, choose the
314314
// shortest one.
315315
minBy<Uri, int>(
316-
_canonicalizeCache.values
317-
.whereNotNull()
316+
_canonicalizeCache.values.nonNulls
318317
.where((result) => result.$2 == canonicalUrl)
319318
.map((result) => result.originalUrl),
320319
(url) => url.path.length)

lib/src/importer/node_package.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// https://opensource.org/licenses/MIT.
44

55
import 'package:cli_pkg/js.dart';
6-
import 'package:collection/collection.dart';
76
import 'package:sass/src/util/map.dart';
87
import 'package:sass/src/util/nullable.dart';
98

@@ -239,7 +238,7 @@ class NodePackageImporter extends Importer {
239238

240239
return null;
241240
})
242-
.whereNotNull()
241+
.nonNulls
243242
.toList();
244243

245244
return switch (matches) {

lib/src/io/js.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ Future<String> readStdin() async {
105105
process.stdin.on('data', allowInterop(([Object? chunk]) {
106106
sink.add(chunk as List<int>);
107107
}));
108-
process.stdin.on('end', allowInterop(([Object? _]) {
108+
process.stdin.on('end', allowInterop(([Object? arg]) {
109109
// Callback for 'end' receives no args.
110-
assert(_ == null);
110+
assert(arg == null);
111111
sink.close();
112112
}));
113113
process.stdin.on('error', allowInterop(([Object? e]) {

lib/src/js/value/calculation.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,10 @@ final JSClass calculationClass = () {
5555
if ((value == null && !_isValidClampArg(min)) ||
5656
(max == null && ![min, value].any(_isValidClampArg))) {
5757
jsThrow(JsError('Expected at least one SassString or '
58-
'CalculationInterpolation in `${[
59-
min,
60-
value,
61-
max
62-
].whereNotNull()}`'));
58+
'CalculationInterpolation in `${[min, value, max].nonNulls}`'));
6359
}
64-
[min, value, max].whereNotNull().forEach(_assertCalculationValue);
65-
return SassCalculation.unsimplified(
66-
'clamp', [min, value, max].whereNotNull());
60+
[min, value, max].nonNulls.forEach(_assertCalculationValue);
61+
return SassCalculation.unsimplified('clamp', [min, value, max].nonNulls);
6762
}
6863
});
6964

test/browser_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@TestOn('browser')
2+
library;
23

34
import 'package:js/js.dart';
45
import 'package:node_interop/js.dart';

test/cli/dart/colon_args_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// https://opensource.org/licenses/MIT.
44

55
@TestOn('vm')
6+
library;
67

78
import 'package:test/test.dart';
89

test/cli/dart/deprecations_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// https://opensource.org/licenses/MIT.
44

55
@TestOn('vm')
6+
library;
67

78
import 'package:test/test.dart';
89

0 commit comments

Comments
 (0)