Learning TypeScript @learningtypescript.com · Feb 6

On a brighter note, the `// @ts-check` comment directive *enables* type checking for a file. This can be handy if you're running TypeScript on JavaScript source files and haven't been able to enable checkJs: true yet. 7/🧵

2 likes 1 replies

?

Replies

Learning TypeScript · Feb 6

Let's talk about some best practices around comment directives. There's more than just "prefer ts-expect-error". First, put explanations with your comment directives. These will help future developers understand why you had to use them - and show that they're not to be used willy-nilly. 8/🧵