Learning TypeScript @learningtypescript.com · 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/🧵

2 likes 1 replies

?

Replies

Learning TypeScript · Feb 6

You can also lint for comment directives! @typescript-eslint.io's `@typescript-eslint/ban-ts-comment` reports if you: * use a ts-ignore or ts-nocheck directive * forget to attach an explanation >3 characters on a ts-expect-error directive Use linting to enforce and teach best practices. 🧠 9/🧵