Linting rules
E006: unused-import
Checks for imports that are never used in the file.
Metadata
Code:E006Rule:unused-importStatus: Stable sincev0.0.1Quick 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";
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.
Last updated on