From 10193368054d235b6c564e2c59ca9c2538f3c847 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Tue, 10 Sep 2024 08:54:03 -0700 Subject: [PATCH 1/2] Update dart_style and use latestLanguageVersion 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/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 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/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 From 20c033bbdd44edc1b9fc803ae17e4a90c9656ead Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Tue, 10 Sep 2024 09:00:18 -0700 Subject: [PATCH 2/2] Remove unneeded inline-class flag const --- web_generator/lib/src/util.dart | 3 --- 1 file changed, 3 deletions(-) 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 {