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 all commits
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
5 changes: 5 additions & 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 - see note below
"target": "esnext",
"module": "nodenext",
"rewriteRelativeImportExtensions": true,
Expand All @@ -90,6 +91,10 @@ but we recommend version 5.8 or newer with the following `tsconfig.json` setting
}
```

> \[!NOTE]
> Use the `noEmit` option if you intend to only execute `*.ts` files, for example a build script.
> You won't need this flag if you intend to distribute `*.js` files for performance reasons.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> You won't need this flag if you intend to distribute `*.js` files for performance reasons.
> You won't need this flag if you intend to distribute `*.js` files.

for whatever reason like npm package

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good to me. I created a new PR since this one already merged.


### Determining module system

Node.js supports both [CommonJS][] and [ES Modules][] syntax in TypeScript
Expand Down
Loading