How to enable type checking in TSLint under WebStorm?
Asked Answered
B

1

15

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?

Byyourleave answered 7/9, 2016 at 2:20 Comment(2)
Unfortunately, these CLI options are currently not supported in WebStorm. Here's a related issue: youtrack.jetbrains.com/issue/WEB-22778 Please follow the updates on that.Groundling
Is there a way to do this in 2019?Stephanus
I
3

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

Immorality answered 2/1, 2018 at 3:1 Comment(1)
The project is deprecatedStephanus

© 2022 - 2024 — McMap. All rights reserved.