Skip to content

Commit c438416

Browse files
authored
Update to latest lints, require Dart ^3.1 (dart-archive/markdown#568)
1 parent 6c4a989 commit c438416

File tree

7 files changed

+14
-31
lines changed

7 files changed

+14
-31
lines changed

pkgs/markdown/.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: [2.19.0, dev]
50+
sdk: [3.1, dev]
5151
steps:
5252
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
5353
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d

pkgs/markdown/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 7.1.2-wip
22

3+
* Require Dart `^3.1.0`.
34
* Update all CommonMark specification links to 0.30.
45
* Fix beginning of line detection in `AutolinkExtensionSyntax`.
56

pkgs/markdown/analysis_options.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ analyzer:
1111
# The example app explicitly takes a String of user-generated HTML and
1212
# inserts it straight into a <div> using innerHtml.
1313
unsafe_html: ignore
14+
# Waiting on a couple of bug fixes and new features before this should be enabled
15+
comment_references: ignore
1416

1517
linter:
1618
rules:
@@ -25,15 +27,11 @@ linter:
2527
- missing_whitespace_between_adjacent_strings
2628
- no_adjacent_strings_in_list
2729
- package_api_docs
28-
- prefer_const_constructors
2930
- prefer_const_declarations
3031
- prefer_final_locals
3132
- prefer_final_in_for_each
32-
- prefer_relative_imports
33-
- test_types_in_equals
3433
- unnecessary_await_in_return
3534
- unnecessary_raw_strings
3635
- use_if_null_to_convert_nulls_to_bools
3736
- use_raw_strings
3837
- use_string_buffers
39-
- use_super_parameters

pkgs/markdown/pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ executables:
1111
markdown:
1212

1313
environment:
14-
sdk: '>=2.19.0 <3.0.0'
14+
sdk: ^3.1.0
1515

1616
dependencies:
1717
args: ^2.0.0
@@ -20,11 +20,11 @@ dependencies:
2020
dev_dependencies:
2121
build_runner: ^2.0.5
2222
build_version: ^2.0.3
23-
build_web_compilers: '>=3.0.0 <5.0.0'
23+
build_web_compilers: ^4.0.0
2424
collection: ^1.15.0
25-
dart_flutter_team_lints: ^1.0.0
25+
dart_flutter_team_lints: ^2.0.0
2626
html: ^0.15.0
27-
http: '>=0.13.5 <2.0.0'
27+
http: ^1.0.0
2828
io: ^1.0.0
2929
js: ^0.6.3
3030
path: ^1.8.0

pkgs/markdown/tool/expected_output.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,10 @@ Iterable<DataCase> _dataCases({
9292
return results;
9393
}
9494

95-
/// Parse and yield data cases (each a [DataCase]) from the directory containing
96-
/// [library], optionally under [subdirectory].
95+
/// Parse and yield data cases (each a [DataCase]) from [testDirectory].
9796
///
9897
/// By default, only read data cases from files with a `.unit` extension. Data
99-
/// cases are read from files located immediately in [directory], or
98+
/// cases are read from files located immediately in [testDirectory], or
10099
/// recursively, according to [recursive].
101100
///
102101
/// The typical use case of this method is to declare a library at the top of a

pkgs/markdown/tool/stats.dart

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -179,26 +179,11 @@ Future<void> _processConfig(
179179

180180
Object? _convert(Object? obj) {
181181
if (obj is CompareLevel) {
182-
switch (obj) {
183-
case CompareLevel.strict:
184-
return 'strict';
185-
case CompareLevel.error:
186-
return 'error';
187-
case CompareLevel.fail:
188-
return 'fail';
189-
case CompareLevel.loose:
190-
return 'loose';
191-
default:
192-
throw ArgumentError('`$obj` is unknown.');
193-
}
182+
return obj.name;
194183
}
195184
if (obj is Map) {
196-
final map = <String, Object?>{};
197-
obj.forEach((k, v) {
198-
final newKey = k.toString();
199-
map[newKey] = v;
200-
});
201-
return map;
185+
return obj
186+
.map<String, Object?>((key, value) => MapEntry(key.toString(), value));
202187
}
203188
return obj;
204189
}

pkgs/markdown/tool/update_github_emojis.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const _emojisFilePath = 'lib/src/emojis.dart';
3030
/// Reference to emoji map within legacy_emojis.dart
3131
const legacyEmojis = legacy.emojis;
3232

33-
/// AUTO GENERATED by [reconcile_emojis.dart] - this only needed to be done ONCE
33+
/// AUTO GENERATED by `reconcile_emojis.dart` - this only needed to be done ONCE
3434
/// during the reconciliation process with the legacy emoji.
3535
/// This array is ONLY USED when the --useGitHubUnicodes option is used to
3636
/// minimize the visual differences in the output emoji.

0 commit comments

Comments
 (0)