Skip to content

style: preserve trailing commas and format all packages#251

Open
spydon wants to merge 2 commits into
corbado:mainfrom
spydon:chore/preserve-trailing-commas-v2
Open

style: preserve trailing commas and format all packages#251
spydon wants to merge 2 commits into
corbado:mainfrom
spydon:chore/preserve-trailing-commas-v2

Conversation

@spydon

@spydon spydon commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

What

  • Add the Dart formatter option to every package that includes very_good_analysis:

    formatter:
      trailing_commas: preserve

    (corbado_auth, corbado_auth_firebase, passkeys, passkeys_android, passkeys_web, passkeys_platform_interface, passkeys_darwin.) The imported very_good_analysis config only ships the require_trailing_commas lint, not this formatter option, so it was not already set.

  • Run melos run format (plain dart format .) across the whole repo and commit the result.

Why

With trailing_commas: preserve, an existing trailing comma forces the formatter to keep a collection/argument list split across lines, instead of re-deciding the layout itself. Combined with the require_trailing_commas lint that very_good_analysis already enforces, this keeps formatting stable and predictable.

Now that every package is on Dart 3.8 (#250), dart format uses the tall style across the whole repo, so the trailing-comma layout is applied consistently everywhere rather than only in one package.

Generated files

Generated *.g.dart files are formatted along with everything else. No exclusion is configured: at Dart 3.8+ the code generators also emit tall style, so running dart format over them is effectively idempotent and does not fight the generators.

Notes

  • melos run format:check passes (435 files, 0 changed).
  • melos run analyze --fatal-infos still reports pre-existing info lints unrelated to this change.

Merge order

Stacked on #250 (the Dart 3.8 bump). Merge after #250; the diff will then reduce to just the analysis-option and formatting changes.

@spydon spydon force-pushed the chore/preserve-trailing-commas-v2 branch 2 times, most recently from f54a75f to d6efdfd Compare June 29, 2026 07:37
spydon added 2 commits June 29, 2026 10:06
The json_serializable / json_annotation versions used need Dart 3.8.0.
Constraints are left as-is so consumers on Dart 3.8.0 still resolve the
3.8-compatible json versions rather than being forced to 3.9.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant