You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing noEmit: true from default tsconfig.json in type stripping docs #57294
simple things like build scripts written as *.ts files that will never need to be distributed/published
This is exactly the case I ran into.
I have a large build script in JS and it had a bug so I wanted to convert to TS to catch the bug for future authors. Perfect use case for strip types. But then after following the docs, I realized it was emitting JS 😓
I guess I'm having trouble understanding the other use case of why strip types if you plan to use tsc to transpile?
Activity
styfle commentedon Mar 3, 2025
cc @marco-ippolito @nodejs/typescript in case there is a reason this was omitted. I search existing issues and prs but didn't find a reason.
I can create a PR if we want to add,
noEmit: true, just let me know 🤓marco-ippolito commentedon Mar 3, 2025
Since the feature is experimental we'd want to encourage users to transpile, and I generally Id always encourage users to transpile 😆
robpalme commentedon Mar 3, 2025
I think there's two separate use-cases that we cannot express in a single
tsconfig.json.noEmit)*.tsfiles that will never need to be distributed/published.rewriteRelativeImportExtensions)IMO both use-cases are legitimate. Use-case 1 (that @styfle is referring to) is simpler so some folk might prefer it.
styfle commentedon Mar 3, 2025
This is exactly the case I ran into.
I have a large build script in JS and it had a bug so I wanted to convert to TS to catch the bug for future authors. Perfect use case for strip types. But then after following the docs, I realized it was emitting JS 😓
I guess I'm having trouble understanding the other use case of why strip types if you plan to use tsc to transpile?
marco-ippolito commentedon Mar 3, 2025
faster development cycle, no need to wait for tsc to transpile as you develop
We could propose two config, one for transpiling one for not traspiling
styfle commentedon Mar 3, 2025
Yeah two configs might work. Or one config with an optional comment like:
I can create a PR after #57271 merges.
jakebailey commentedon Mar 3, 2025
Yeah, I would just include a note, though I would suggest making it mention "if you are publishing" or something.
styfle commentedon Mar 4, 2025
I created a PR:
noEmit: trueintsconfig.json#57320doc: recommend setting `noEmit: true` in `tsconfig.json`
doc: recommend setting `noEmit: true` in `tsconfig.json`
doc: recommend setting `noEmit: true` in `tsconfig.json`
doc: recommend setting `noEmit: true` in `tsconfig.json`
doc: recommend setting `noEmit: true` in `tsconfig.json`
doc: recommend setting `noEmit: true` in `tsconfig.json`
doc: recommend setting `noEmit: true` in `tsconfig.json`