Learning TypeScript @learningtypescript.com · Feb 6

If you absolutely must disable type checking for a line, almost always prefer `// @ts-expect-error`. It: * Disables type checking on a line * Reports a type error if the comment isn't suppressing any Being told when a comment directive can be removed helps with long-term code cleanliness. 4/🧵

1 likes 1 replies

?

Replies

Learning TypeScript · Feb 6

`// @ts-ignore` is the same as `// @ts-expect-error`, but is allowed to exist and not do anything. This can be useful if you're testing across multiple TypeScript versions or running into other tooling edge case. 5/🧵