From 933a37d2235a63fd63185b3055d6bc0fd23edcfd Mon Sep 17 00:00:00 2001 From: Srujan Gaddam <58529443+srujzs@users.noreply.github.com> Date: Tue, 10 Sep 2024 09:40:28 -0700 Subject: [PATCH] Update dart_style and use latestLanguageVersion (#301) languageVersion will soon be a required parameter. For our purposes, it suffices to use the latest as it includes formatting for extension types. --- web_generator/lib/src/dart_main.dart | 2 +- web_generator/lib/src/util.dart | 3 --- web_generator/pubspec.yaml | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/web_generator/lib/src/dart_main.dart b/web_generator/lib/src/dart_main.dart index 6f6f6797..5d97c07c 100644 --- a/web_generator/lib/src/dart_main.dart +++ b/web_generator/lib/src/dart_main.dart @@ -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()); } diff --git a/web_generator/lib/src/util.dart b/web_generator/lib/src/util.dart index 3b2dd0ad..2c80fa6e 100644 --- a/web_generator/lib/src/util.dart +++ b/web_generator/lib/src/util.dart @@ -30,9 +30,6 @@ final List 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 { diff --git a/web_generator/pubspec.yaml b/web_generator/pubspec.yaml index 66fb95da..b3bc534c 100644 --- a/web_generator/pubspec.yaml +++ b/web_generator/pubspec.yaml @@ -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