logoalt Hacker News

whilenot-dev • today at 6:08 AM • 2 replies • view on HN

> A mismatch would mean you would get type errors inside the library code

OP doesn't want the types to be checked, they want the types to be stripped. Type stripping ignores tsconfig.json files and any of its features, see: https://nodejs.org/api/typescript.html#type-stripping


Replies

zarzavat • today at 7:41 AM

Type stripping cannot ignore tsconfig.

TypeScript has different semantics depending on settings in tsconfig e.g. useDefineForClassFields

➕ show 1 reply
DanRosenwasser • today at 6:48 AM

Yes, but your TypeScript code has to be checked against the libraries in node_modules, and it is significantly costlier to check against implementation files (the .ts/.mts files) than the produced declaration files (the .d.ts files).

➕ show 1 reply