Skip to content

doc: recommend setting noEmit: true in tsconfig.json #57320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/api/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ but we recommend version 5.8 or newer with the following `tsconfig.json` setting
```json
{
"compilerOptions": {
"noEmit": true, // Optional - prevent tsc from emitting transpiled JS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current wording is a literal description of the tsconfig flag - which can be independently googled. I think the added value we can bring here in the docs is to explain why you might want to use it. For example...

Suggested change
"noEmit": true, // Optional - prevent tsc from emitting transpiled JS
"noEmit": true, // Optional - see Note (1)
...
Note (1): `"noEmit"` is useful if your code is only intended to be consumed and executed as `*.ts` files. If instead you need to produce `*.js` files for performance or distribution reasons, you won't need this flag.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a variation of this in 839322d

"target": "esnext",
"module": "nodenext",
"rewriteRelativeImportExtensions": true,
Expand Down
Loading