Skip to content

Commit c1e39ed

Browse files
authored
Bump lints, require Dart 3.3 (dart-archive/source_maps#88)
1 parent d8dfdf3 commit c1e39ed

File tree

6 files changed

+18
-15
lines changed

6 files changed

+18
-15
lines changed

pkgs/source_maps/.github/workflows/test-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
matrix:
4848
# Add macos-latest and/or windows-latest if relevant for this package.
4949
os: [ubuntu-latest]
50-
sdk: [3.0.0, dev]
50+
sdk: [3.3.0, dev]
5151
steps:
5252
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
5353
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3

pkgs/source_maps/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 0.10.13-wip
22

3-
- Require Dart 3.0
3+
- Require Dart 3.3
44

55
## 0.10.12
66

pkgs/source_maps/lib/parser.dart

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Mapping parseJson(Map map,
6666
if (map.containsKey('mappings') ||
6767
map.containsKey('sources') ||
6868
map.containsKey('names')) {
69-
throw FormatException('map containing "sections" '
69+
throw const FormatException('map containing "sections" '
7070
'cannot contain "mappings", "sources", or "names".');
7171
}
7272
return MultiSectionMapping.fromJson(map['sections'] as List, otherMaps,
@@ -110,13 +110,13 @@ class MultiSectionMapping extends Mapping {
110110
{/*String|Uri*/ Object? mapUrl}) {
111111
for (var section in sections.cast<Map>()) {
112112
var offset = section['offset'] as Map?;
113-
if (offset == null) throw FormatException('section missing offset');
113+
if (offset == null) throw const FormatException('section missing offset');
114114

115115
var line = offset['line'] as int?;
116-
if (line == null) throw FormatException('offset missing line');
116+
if (line == null) throw const FormatException('offset missing line');
117117

118118
var column = offset['column'] as int?;
119-
if (column == null) throw FormatException('offset missing column');
119+
if (column == null) throw const FormatException('offset missing column');
120120

121121
_lineStart.add(line);
122122
_columnStart.add(column);
@@ -125,7 +125,8 @@ class MultiSectionMapping extends Mapping {
125125
var map = section['map'] as Map?;
126126

127127
if (url != null && map != null) {
128-
throw FormatException("section can't use both url and map entries");
128+
throw const FormatException(
129+
"section can't use both url and map entries");
129130
} else if (url != null) {
130131
var other = otherMaps?[url];
131132
if (otherMaps == null || other == null) {
@@ -137,11 +138,11 @@ class MultiSectionMapping extends Mapping {
137138
} else if (map != null) {
138139
_maps.add(parseJson(map, otherMaps: otherMaps, mapUrl: mapUrl));
139140
} else {
140-
throw FormatException('section missing url or map');
141+
throw const FormatException('section missing url or map');
141142
}
142143
}
143144
if (_lineStart.isEmpty) {
144-
throw FormatException('expected at least one section');
145+
throw const FormatException('expected at least one section');
145146
}
146147
}
147148

@@ -342,7 +343,7 @@ class SingleMapping extends Mapping {
342343
urls.keys.toList(), names.keys.toList(), lines);
343344
}
344345

345-
SingleMapping.fromJson(Map<String, dynamic> map, {mapUrl})
346+
SingleMapping.fromJson(Map<String, dynamic> map, {Object? mapUrl})
346347
: targetUrl = map['file'] as String?,
347348
urls = List<String>.from(map['sources'] as List),
348349
names = List<String>.from((map['names'] as List?) ?? []),

pkgs/source_maps/lib/src/source_map_span.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ class SourceMapSpan extends SourceSpanBase {
1414
/// If this is `true`, [text] is the value of the identifier.
1515
final bool isIdentifier;
1616

17-
SourceMapSpan(SourceLocation start, SourceLocation end, String text,
18-
{this.isIdentifier = false})
19-
: super(start, end, text);
17+
SourceMapSpan(super.start, super.end, super.text,
18+
{this.isIdentifier = false});
2019

2120
/// Creates a [SourceMapSpan] for an identifier with value [text] starting at
2221
/// [start].

pkgs/source_maps/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ description: A library to programmatically manipulate source map files.
44
repository: https://github.com/dart-lang/source_maps
55

66
environment:
7-
sdk: ^3.0.0
7+
sdk: ^3.3.0
88

99
dependencies:
1010
source_span: ^1.8.0
1111

1212
dev_dependencies:
13-
dart_flutter_team_lints: ^1.0.0
13+
dart_flutter_team_lints: ^2.0.0
1414
term_glyph: ^1.2.0
1515
test: ^1.16.0

pkgs/source_maps/test/parser_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
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+
// ignore_for_file: inference_failure_on_collection_literal
6+
// ignore_for_file: inference_failure_on_instance_creation
7+
58
import 'dart:convert';
69

710
import 'package:source_maps/source_maps.dart';

0 commit comments

Comments
 (0)