Acton
Linting rules

E006: unused-import

Checks for imports that are never used in the file.

Metadata

  • Code: E006
  • Rule: unused-import
  • Status: Stable since v0.0.1
  • Quick fix: sometimes available

What it does

Checks for imports that are never used in the file.

Why is this bad?

Unused imports clutter the code and increase compilation time.

Example

import "other.tolk";
E006: unused import
fun main() { println("hello"); }

Use instead:

fun main() {
    println("hello");
}

Behavior notes

  • Autofix is available only when the unused import can be removed as a whole-line edit.
  • If multiple imports share one line, warning is emitted but autofix is skipped.
  • Whole-line autofix also removes inline comments attached to that import line.
Source code

Last updated on

On this page