When writing TypeScript code with ESM, it can sometimes be desirable to import or export a type only in the type system. Code may wish to refer to a type, but not actually import or export a corresponding value.
- Why would you want to use these type-only imports and exports?
- How can you enforce a project use them whenever necessary?
Let's dig in!