doc: recommend setting noEmit: true in tsconfig.json

PR-URL: https://github.com/nodejs/node/pull/57320
Fixes: https://github.com/nodejs/node/issues/57294
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
Steven
2025-03-06 17:30:59 -05:00
committed by GitHub
parent a7909014f7
commit 5401ac687c

View File

@@ -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,
@@ -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.
### Determining module system
Node.js supports both [CommonJS][] and [ES Modules][] syntax in TypeScript