slang-i18n / slang

Type-safe i18n for Dart and Flutter
https://pub.dev/packages/slang
MIT License
459 stars 39 forks source link

Request for Auto-Formatting of Generated Code #184

Open K9i-0 opened 8 months ago

K9i-0 commented 8 months ago

The code generated by slang currently shows differences when formatted with dart format ..

I want it to auto-format like in packages using source_gen, like freezed. They use DartFormatter from the dart_style package. Using DartFormatter the same way should work. https://pub.dev/packages/dart_style#using-the-dart_style-api

Similar to Issue #163

Tienisto commented 8 months ago

Unfortunately, slang is a regular dependency and not a dev dependency. This will also not change in the near future because Translation Overrides reuses most logic from the generator.

A trade-off would be to add this to slang_build_runner but this will make the generated code of dart run slang and dart run build_runner build different / inconsistent.