Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable type checking in TSLint under WebStorm?

I have some rules in my tslint.json that require the --type-check functionality. WebStorm doesn't give me a way to add the command-line argument and to the TSLint plugin. It also doesn't give me a way to enable it from the GUI.

As a result TSLint crashes and the TSLint plugin reports an error and I can't see the inspections.

It works when I run TSLint from the command-line with the --type-check argument, but I need the inspections in the IDE.

Does anyone have a workaround for this situation?

like image 318
Hristo Kolev Avatar asked Sep 07 '16 02:09

Hristo Kolev


1 Answers

As of WebStorm 2017.2, this is now possible using a TypeScript language service plugin. You can install https://github.com/angelozerr/tslint-language-service and then add it to your tsconfig.json (see the instructions in the README), and it will make TSLint errors show up alongside normal TypeScript errors. You can then disable the built-in TSLint integration in WebStorm.

More background is in the relevant WebStorm issue: https://youtrack.jetbrains.com/issue/WEB-22778

like image 190
Alan Pierce Avatar answered Nov 12 '22 09:11

Alan Pierce