Unnecessary imports refer to importing types that are not used or referenced anywhere in the code.
include::../description.adoc[]
== How to fix it
While it's not difficult to remove these unneeded lines manually, modern code editors support the removal of every unnecessary import with a single click from every file of the project.
=== Code examples
==== Noncompliant code example
[source,dart,diff-id=1,diff-type=noncompliant]
----
import 'package:dart_hello_world/dart_hello_world.dart' as dart_hello_world;
* The import of '<unnecessary import path>' is unnecessary because all of the used elements are also provided by the import of '<including import path>'.
* Duplicate import.
=== Highlighting
The string literal of the path of the unused import statement.