How to remove unused imports in Intellij IDEA on commit?

前端 未结 9 1659
遥遥无期
遥遥无期 2020-12-23 02:57

Is there a way to remove unused imports in Intellij IDEA on commit?

It is not very optimal to do it manually, CTRL + ALT + O helps b

9条回答
  •  余生分开走
    2020-12-23 03:17

    When you commit, tick the Optimize imports option on the right. This will become the default until you change it.

    I prefer using the Reformat code option as well.

提交回复
热议问题