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.

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

3 Answers 3

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

2
  • 1
    How to undo suppress for this statement? Oct 17, 2019 at 7:00
  • 1
    Delete the comment //noinspection JSUnusedGlobalSymbols
    – mrclrchtr
    Oct 17, 2019 at 14:03
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

6
  • 3
    Just FYI: TSLint errors normally have 'TSLint' prefix in tooltip
    – lena
    Apr 22, 2016 at 14:06
  • Hi Lena, How can I disable that only in the current file ? Maybe in the form of, how tslint does it ?
    – user2227400
    Apr 22, 2016 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, 2016 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, 2016 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, 2017 at 11:58
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.