Remove potentially unused imports (heuristic)

Proprietary

Removes imports where the imported simple name does not appear in the rest of the file. Imports of implicit definitions and imports that can't be resolved are kept, since they may be used implicitly. This is an approximate heuristic and may produce false positives.

org.openrewrite.scala.safety.RemoveUnusedImport
mod run . --recipe=org.openrewrite.scala.safety.RemoveUnusedImport

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.