Loading...
import { User } from './types';
enum Role { Admin, User }
export const check = (u: User) => u.role === Role.Admin;import type { User } from './types.ts';
const Role = { Admin: 'admin', User: 'user' } as const;
export const check = (u: User) => u.role === Role.Admin;Type stripping needs import type, real '.ts' extensions and no enum, so an as const object replaces it.
tsconfig.json fail at runtime, since stripping does not apply them.tsc --noEmit in CI, since stripping skips it.enum, parameter properties or runtime namespaces.import type.No. It only removes annotations. Run tsc --noEmit separately to catch type errors.
No. Options like paths and target are ignored; Node only removes the type syntax.
Not with pure stripping, because enum creates runtime code. Use a union of literals or an as const object.