How can I ignore a certain WebStorm inspection error?

拥有回忆 提交于 2019-12-01 15:40:13

问题


Following tries do not work:

/* tslint:disable:"no-unused-variable" */

/* tslint:disable:'no-unused-variable' */

/* tslint:disable:no-unused-variable */

Maybe Webstorm has other linting mechanisms working in the background? How can I disable them, so that only tslint is active?

EDIT: The desired solution would be to do it at the source code level, without configuring any IDE Settings.


回答1:


This warning doesn't come from TSLint, so configuring TSLint won't help here. This is WebStorm own inspection error. You can either disable this inspection or suppress it for current statement: hit Alt+Enter on 'isDone', then hit Right and choose the appropriate action from the popup. See https://www.jetbrains.com/help/webstorm/2016.1/suppressing-inspections.html#1




回答2:


You can do it with

//noinspection JSUnusedGlobalSymbols

in Webstorm version 2016.3

To get this code, i used:

ALT + Enter
Select "Remove unused constant 'xxx'" but dont Enter
Arrow right
Suppress for statement



来源:https://stackoverflow.com/questions/36795435/how-can-i-ignore-a-certain-webstorm-inspection-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!