ts-morph
28.0.0 · 12 Apr 2026MIT46.3M / weekRepositoryHomepagenpmAtom feed
4.3.3 is the newest release of 4.x.
In short
5 breaking5 new1 faster2 fixed4 internal
- Breaking
DiagnosticMessageChain#getNext()now returns an array to match TS 3.6. - Breaking
SourceFile#getReferencedFiles()is nowgetPathReferenceDirectives(). - Breaking
CodeBlockWriter#indentBlockis nowindent.withHangingIndentationis nowhangingIndent.withHangingIndentationUnlessBlockis nowhangingIndentUnlessBlock. - Breaking
DirectoryEmitResult#getEmitSkipped()was removed. Check the output file paths and skipped file paths instead as that's more accurate. - Breaking
CompilerExtendedCommentis now calledCompilerCommentNode.
Release note
The section about ts-morph of a note shared by several packages.
Bug Fixes
JSDoc.getInnerText would sometimes get the wrong text if the first line content contained an asterisk.
Fix getParent() for TS 3.6.
Features
Calling
Project#createSourceFilewith an existing file name now suggests to add the overwrite option.Add past parent as second parameter to getParentWhile
Add
Type#getPropertyOrThrowAdd
SourceFile#getReferencedSourceFiles(),#getNodesReferencingOtherSourceFiles(), and#getLiteralsReferencingOtherSourceFiles().Upgrade to code-block-writer 10.0.0.
Performance Improvements
Bundle scripts
Breaking changes
- Breaking
SourceFile#getReferencedFiles()is nowgetPathReferenceDirectives().
This was done to prevent confusion with upcoming methods in #680. The name was chosen because it is similar to the methods getTypeReferenceDirectives() and getLibReferenceDirectives().
- Breaking
CodeBlockWriter#indentBlockis nowindent.withHangingIndentationis nowhangingIndent.withHangingIndentationUnlessBlockis nowhangingIndentUnlessBlock. - Breaking
DiagnosticMessageChain#getNext()now returns an array to match TS 3.6. - Breaking
DirectoryEmitResult#getEmitSkipped()was removed. Check the output file paths and skipped file paths instead as that's more accurate. - Breaking
CompilerExtendedCommentis now calledCompilerCommentNode.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.