Skip to content

Commit

Permalink
Update dart_style and use latestLanguageVersion (#301)
Browse files Browse the repository at this point in the history
languageVersion will soon be a required parameter. For our
purposes, it suffices to use the latest as it includes
formatting for extension types.
  • Loading branch information
srujzs committed Sep 10, 2024
1 parent fb30192 commit 933a37d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion web_generator/lib/src/dart_main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ String _emitLibrary(code.Library library) {
);

final source = library.accept(emitter);
return DartFormatter(experimentFlags: [inlineClassExperimentFlag])
return DartFormatter(languageVersion: DartFormatter.latestLanguageVersion)
.format(source.toString());
}
3 changes: 0 additions & 3 deletions web_generator/lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ final List<String> mozLicenseHeader = [
'under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/.',
];

// Needed for dart_style until 2.3.5 is published.
const String inlineClassExperimentFlag = 'inline-class';

const String generatedFileDisclaimer = 'Generated from Web IDL definitions.';

extension StringExt on String {
Expand Down
2 changes: 1 addition & 1 deletion web_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
code_builder: ^4.10.0
collection: ^1.18.0
dart_flutter_team_lints: ^3.0.0
dart_style: ^2.3.4
dart_style: ^2.3.7
io: ^1.0.4
path: ^1.8.3
test: ^1.24.4

0 comments on commit 933a37d

Please sign in to comment.