When you have multiple imports in dart, with comments, and then trigger "Optimize Imports", the comments are put below all imports.
So you end up with a list of comments at the end of all imports which is less than ideal.
This happens with comments in a separate line as well as comments at the end of the line.
So this:
import 'foo.dart'; // comment
// comment
import 'bar.dart';
results in:
import 'bar.dart';
import 'foo.dart';
// comment
// comment
I would expect:
// comment
import 'bar.dart';
import 'foo.dart'; // comment
This is important, because when working with polymer elements, you need to use // ignore: UNUSED_IMPORT when importing a polymer element.
@scheglov
I believe imports can have annotations, which should be retained. I guess comments should be considered as annotations (except that you can also have a comment after the import).
This is still an issue and a real hassle for the linter, where, for example, we ignore implementation_imports liberally.
It's made even worse if you optimize imports on save. 鈽癸笍
I _really_ want this one to get fixed; I just never manage to find the time for it.
... we ignore implementation_imports liberally.
That needs to be fixed! There shouldn't be any need for importing from src once we've gotten the new public API figured out.
That needs to be fixed! There shouldn't be any need for importing from src once we've gotten the new public API figured out.
馃憤
Most helpful comment
I _really_ want this one to get fixed; I just never manage to find the time for it.
That needs to be fixed! There shouldn't be any need for importing from
srconce we've gotten the new public API figured out.