Can I force the TypeScript compiler to use nominal typing?
There is no compiler flag to make the compiler behave in a nominal way, indeed there in principle can’t be such a flag as that would break a lot of javascript scenarios. There are several techniques generally used to emulate some kind of nominal typing. Branded types are usually used for primitives (pick one from … Read more