dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.31k stars 1.59k forks source link

dartfix feature request: Remove unnecessary imports of dart:async #34990

Open kwalrath opened 6 years ago

kwalrath commented 6 years ago

As of 2.1.0-dev.5.0, dart:core exports Future & Stream. This makes many imports of dart:async unnecessary.

I'd like dartfix to automatically remove unnecessary imports of dart:async.

bwilkerson commented 6 years ago

Do you specifically want it to be limited to dart:async, or should it remove all unnecessary imports?

kwalrath commented 6 years ago

I don't particularly care. Removing all unnecessary imports would be fine. :)

lrhn commented 6 years ago

Make sure that DartDoc references count as uses, especially if they are the only use of an import. :)

It's also dangerous (i.e., wrong) to remove the import of dart:async if the code in question has an SDK dependency below 2.1.