在 Android Studio 或 IntelliJ 中将未使用的导入报告为错误 [英] Report unused imports as error in Android Studio or IntelliJ
本文介绍了在 Android Studio 或 IntelliJ 中将未使用的导入报告为错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Android Studio 中是否有任何方法/设置可以将 java 文件中未使用的导入报告为错误?
Is there any way/setting in Android Studio to report the unused imports in java files as error?
在 Eclipse 中,lint 很容易将此报告为错误.
In Eclipse, lint reported this as error pretty easily.
推荐答案
适用于 Android Studio 和 IntelliJ
您可以转到 File/Settings
,然后浏览到 Editor/Inspections/Import.
You could go to File/Settings
then browse to Editor/Inspections/Import.
将未使用导入的严重性更改为 Error
Change Severity of Unused Import to Error
这篇关于在 Android Studio 或 IntelliJ 中将未使用的导入报告为错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文