DEV Community

Bruce Axtens
Bruce Axtens

Posted on

TSLint lints Typescript

Whilst searching for something else I came across the word "TSLint". Hmm ...

So I went off looking for TSLint and found a blurb about installing it using yarn. I remembered that scoop does yarn so I did a scoop install yarn then the instructions regarding yarn.

Now I don't have the yarn-based install because the tslint support in VSCode is via npm. And now I don't have yarn either after scoop uninstall yarn. (I'm waiting for someone to convince me I need yarn).

This tslint thing is interesting and a little annoying too. One of the annoyings is that the external.d.ts file that I've been building today is now full of 'problems' that tslint has identified and it wants me to put every class definition in a separate file (that won't happen this month.)

The more useful thing is that in my project files I'm now getting reminded to remove var in favour of const and let, and anonymous functions in favour of => which is fair enough. And seeing as I have ts2gas installed, these will get appropriately transcoded when next I do a clasp push.

Mind you, now I have to keep wandering off to find out what these tslint error mean and what to do about them, if anything. Like

Expected a 'for-of' loop instead of a 'for' loop with this simple iteration:
 tslint(prefer-for-of)
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
pizmovc profile image
Luka

Just a heads up:

⚠️ TSLint will be deprecated some time in 2019

from their gitHub.

Collapse
 
bugmagnet profile image
Bruce Axtens

News to me. Thanks very much!