this post was submitted on 08 Jan 2026
10 points (91.7% liked)
Programming
24386 readers
484 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I use ktlint with spotless. If you want to remove unused imports and wildcard imports, you need to activate those rules in your .editorconfig file in your project dir.
Please add following lines to your .editorconfig for correct behavior with IntelliJ:
https://pinterest.github.io/ktlint/latest/rules/configuration-intellij-idea/
No unused imports and no wildcard imports are standard rules:
https://pinterest.github.io/ktlint/latest/rules/standard/
Add ktlint rules in the same file:
I tried ktlint, it was having trouble handling libraries and kept giving me no reference errors for library imports.
Well, I recommend you trying to use the spotless plugin for Maven/Gradle and configuring ktlint or ktfmt. Maybe try ktlint first with my configuration tips. If it doesn't work, you could show us your repository or a snippet of it.