Personally though, I think vscode should have a feature to automatically highlight `any` variables is TS code, which would serve roughly the same purpose.
As another commenter mentioned, this is much better when using something like Zod to do the cast safely.
If you treat `unknown` as C's `void*`, then you're not getting much out of your type checks.
`any` is a contagious/viral construct where anything it touches could become `any`. And then you spiral out of control and the whole codebase gets nothing from typescript but gets all the operational overhead.
If your browser doesn't support text fragments, can cmd/ctrl+f for "contagious" and/or "gradual" https://www.typescriptlang.org/docs/handbook/typescript-in-5......
Final note is that you likely shouldn't blindly cast unknown to stuff that you hope it is but instead use type guards to find out what the type is.
Zod is really good at making this ergonomic for most use cases. More niche types using nonprimitives or uncopyable attributes require hand rolled type guards :/
Type guards also update the type of your unknown var after it passes through them if you gate scopes with them if(isX(y)) {...}
Additional guards will merge attributes onto the type