Comment on Adding type safety to object IDs in TypeScriptparentComments−kristiandupont2ySure, the TS type system is not sound but the idea is not to stop "bad guys", it's to help you realize you are doing something unintended.−jwalton2yThis is very true, but "helping you realize you are doing something unintended" works just as well with a string as with a symbol.−presentation2yAgreed, for instance in our codebase we just make all type assertions a lint error demanding a justification, as well as flat out banning the any type. But anyone is free to write shoddy TypeScript.
Comments
Sure, the TS type system is not sound but the idea is not to stop "bad guys", it's to help you realize you are doing something unintended.
This is very true, but "helping you realize you are doing something unintended" works just as well with a string as with a symbol.
Agreed, for instance in our codebase we just make all type assertions a lint error demanding a justification, as well as flat out banning the any type. But anyone is free to write shoddy TypeScript.