DARTFMT 格式化@Component装饰器异常,疑似Bug求助
Hey there! Let's tackle this issue step by step.
First, regarding where to submit this bug report: The right place for Dart SDK or tooling-related issues (like dartfmt) is the official Dart SDK issue tracker. No need to worry about submitting in the wrong spot—just head over there once you've got the details ready.
Now, about the messy formatting of the @Component decorator with dartfmt 1.0.12 (shipped with the latest Dart 2 dev build): This definitely looks like an unexpected formatting quirk. To help the team fix it quickly, you'll want to provide a bit more context when submitting the issue.
First, let's clean up the code snippet you shared for clarity:
import 'package:angular/angular.dart'; import 'package:angular_router/angular_router.dart'; import 'routes.dart'; @Component(...) // Your component class definition would go here
When you file the bug, make sure to include:
- The full, complete @Component configuration (the
...part filled in—this is crucial for reproducing the issue) - The exact version number of the Dart 2 dev SDK you're using (not just "latest")
- A side-by-side comparison of your original code and the messed-up formatted output, so the team can clearly see what's wrong
Also, a quick pre-submission check: Try upgrading to the most recent stable release of the Dart SDK if possible, to see if the issue has already been fixed in a newer version. Sometimes dev builds have unpolished bugs that get resolved in stable releases.
内容的提问来源于stack exchange,提问作者Arne Wolframm

