Code inspections代码检查
In WebStorm, there is a set of code inspections that detect and correct anomalous code in your project. 在WebStorm中,有一组代码检查可以检测和纠正项目中的异常代码。The IDE can find and highlight various problems, locate dead code, find probable bugs, spelling problems, and improve the overall code structure.IDE可以发现并突出显示各种问题,定位死代码,发现可能的bug、拼写问题,并改进总体代码结构。
Inspections can scan your code in all project files, or only in specific scopes (for example, only in production code, or in modified files).检查可以扫描所有项目文件中的代码,也可以只扫描特定范围内的代码(例如,只扫描生产代码或修改后的文件)。
Every inspection has a severity level— the extent to which a problem can affect your code. 每次检查都有一个严重性级别:问题对代码的影响程度。Severities are highlighted differently in the editor so that you can quickly distinguish between critical problems and less important things. 严重性在编辑器中以不同方式突出显示,以便您可以快速区分关键问题和不太重要的事情。WebStorm comes with a set of predefined severity levels and enables you to create your own.WebStorm附带了一组预定义的严重性级别,允许您创建自己的严重性级别。
Inspections and their settings are grouped in profiles. 检查及其设置在配置文件中分组。Each profile contains the information on the enabled inspections, a scope of files that they analyze, and their severity levels.每个概要文件都包含有关已启用检查的信息、它们分析的文件范围及其严重性级别。
Access all available inspections and their settings访问所有可用的检查及其设置
-
In the Settings/Preferences dialog Ctrl+Alt+S, go to .
Use 使用 to filter the inspections list.
来筛选检查列表。
For example, you can filter inspections by severity or by language.例如,您可以按严重性或语言筛选检查。