10

Following tries do not work:

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

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

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

enter image description here

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.

Buh Buh
  • 7,443
  • 1
  • 34
  • 61
  • Have you created your own `tslint.json` file at the root of your project folder? – DrinkBird Apr 22 '16 at 13:46
  • yes, all the rules are working properly, I want to disable a certain one,.. –  Apr 22 '16 at 13:51
  • Oh ok. It seems that the official documentation mentions what you're already trying: https://github.com/palantir/tslint#rule-flags – DrinkBird Apr 22 '16 at 13:56

3 Answers3

9

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

Suppress for statement

mrclrchtr
  • 948
  • 10
  • 14
7

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

lena
  • 90,154
  • 11
  • 145
  • 150
  • 3
    Just FYI: TSLint errors normally have 'TSLint' prefix in tooltip – lena Apr 22 '16 at 14:06
  • Hi Lena, How can I disable that only in the current file ? Maybe in the form of, how tslint does it ? –  Apr 22 '16 at 14:08
  • You can select a scope for inspection: in Settings | Appearance & Behavior | Scopes create a scope with this file excluded, then select this scope for 'Unused javaScript/ActionScript local symbol' inspection in Settings | Editor | Inspections – lena Apr 22 '16 at 14:15
  • 2
    this can't be done using comments. You can suppress it for current statement, but not for current file – lena Apr 22 '16 at 14:20
  • WebStorm 2016.3 seems useless in this respect on MacOS anyway, unless I've missed some hidden configuration option. No popup exists to apply an inspection override. – Jackpile Jan 28 '17 at 11:58
  • as you can see in my solution (https://stackoverflow.com/questions/36795435/how-can-i-ignore-a-certain-webstorm-inspection-error/40770509#40770509), it can be done using comments ;) – mrclrchtr Jun 22 '17 at 07:00
0

"[tslint] " should be ' (quotemark)

In order to fix "[tslint] " should be ' (quotemark) error open tslint.json file and set editor.formatOnSave to true as shown below:

"editor.formatOnSave": true
Murat Yıldız
  • 11,299
  • 6
  • 63
  • 63