! Also happens to be the correct way to deal with this, I have to use it sometimes when using typescript for web frontend stuff since it's the only way to make the compiler know a certain element is going to be in the DOM since tsc doesn't read the HTML files in your project as far as I know.
View all comments
Show parent comment
3
u/RadiantDevelopment1 Jan 23 '22
I like ts-expect-error over ts-ignore because it forces you to clean up the comment if the underlying issue changes.
But I prefer ! for this case because of it's more limited space.