Disable and suppress inspections
Some inspections may report problems that you currently do not want to see. In this case, you can disable or suppress them.
When you disable an inspection, you turn it off. It means that the code analysis engine stops searching project files for the problem that this inspection is designed to detect. Note that when you disable an inspection, you disable it in the current inspection profile; it remains enabled in other profiles.
Disable inspections
Disable an inspection in the settings
Disable an inspection in the editor
You can quickly disable a triggered inspection directly in the editor.
Place the caret at the highlighted string and press Alt+Enter (or use the intention action ).
Click next to the inspection you want to disable, and select Disable inspection.
Disable an inspection in the Results tool window
In the Inspection Results tool window (after running code analysis), right-click the inspection you want to disable and select Disable inspection.
Click to hide the disabled inspection alerts.
Suppress inspections
When you suppress an inspection, the code analysis engine doesn't highlight the problem found by this inspection in the specific piece of code (class, method, or statement). You can also suppress all inspections in the current class.
Suppress an inspection in the editor
Place the caret at the highlighted string and press Alt+Enter (or use the intention action ).
-
Click next to the inspection you want to suppress, and select the necessary suppress action.
Suppress an inspection in the Results tool window
-
In the Inspection Results tool window (after running code analysis), right-click the detected problem which you want to ignore and select Suppress for statement from the context menu.
-
To suppress an inspection in the whole file, right-click the file and select Suppress for statement from its context menu.
Alternatively, select the file and then select Suppress for statement from the list in the right-hand pane.
Change the highlighting level for a file
By default, WebStorm highlights all detected code problems. You can change this behavior for the file you are currently working with. Click in the status bar (bottom right-hand corner), and select one of these options:
None: turn highlighting off.
Syntax: highlight syntax problems only.
Inspections: (default) highlight syntax problems and problems found by inspections.
You can also change the highlighting level from the main menu. Select, or press Ctrl+Shift+Alt+H.