diff --git a/doc/api/typescript.md b/doc/api/typescript.md index bad8f44001c04e..3b3f615953cb93 100644 --- a/doc/api/typescript.md +++ b/doc/api/typescript.md @@ -68,6 +68,21 @@ By intentionally not supporting syntaxes that require JavaScript code generation, and by replacing inline types with whitespace, Node.js can run TypeScript code without the need for source maps. +Type stripping works with most versions of TypeScript +but we recommend version 5.7 or newer with the following `tsconfig.json` settings: + +```json +{ + "compilerOptions": { + "target": "esnext", + "module": "nodenext", + "allowImportingTsExtensions": true, + "rewriteRelativeImportExtensions": true, + "verbatimModuleSyntax": true + } +} +``` + ### Determining module system Node.js supports both [CommonJS][] and [ES Modules][] syntax in TypeScript