this post was submitted on 18 Oct 2023
341 points (96.2% liked)

Programmer Humor

32192 readers
442 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] PoopMonster 43 points 11 months ago (2 children)

Just as irritating as seeing people use linters only to have a lot of files with @ts-ignore all over the place... Like why even bother?

[–] [email protected] 8 points 11 months ago

oh you've got a private variable that I want to use? No worries, (foo as any)['secret'].

[–] [email protected] 3 points 11 months ago* (last edited 11 months ago)

I’ve literally just put ts-ignore in many many files. The reason was legacy stuff, we had the ts check off (which blocks a merge if it failed), because there were just too many files that would need fixing. We thought about the best way to add the check so that new files have to have proper types, while having an easy way to slowly fix old ones.

We decided to go with ts-ignore for every file and a lint warning for the same line. So you see it in each file if it needs to be fixed, but you’re not going blind for red ts errors everywhere or don’t have the check at all.