npm / ts-morph
ts-morph
What changed in ts-morph 13 to 28, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
18 breaking1 deprecations27 new APIs and options1 performance3 behavior and defaults7 tooling25 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initts-morph 283 changes
Breaking changes 1
ts-morph now uses TypeScript 6.0, which introduces breaking changes that may affect developers.
New APIs and options 1
A standalone function prints structures to a string.
Fixes and other changes 1
Fixes an InvalidOperationError in addTypeArgument.
ts-morph 277 changes
New APIs and options 4
Add the ability to add and remove the defer keyword in imports.
Add getAwaitedType to TypeChecker.
Add a wrapper for JSDocImportTag.
Add a wrapper for OptionalTypeNode.
Tooling 1
Add support for TypeScript 5.9.
Fixes and other changes 2
Remove invalid sourceMappingURL from build output.
Re-export StandardizedFilePath from @ts-morph/common.
ts-morph 262 changes
Tooling 1
Adds support for TypeScript 5.8.
Fixes and other changes 1
Improves comma appending logic to handle nested template literals correctly.
ts-morph 253 changes
Breaking changes 1
Throws a descriptive error when inserting a variable statement with no declarations.
Fixes and other changes 2
Removing the last named import or export no longer removes or changes the declaration.
Properly inserts the async keyword when setting an arrow function as async.
ts-morph 243 changes
Tooling 1
Added support for TypeScript 5.6.
Fixes and other changes 2
Fixed getBodyText() so it works as expected.
Corrected getDerivedClasses() results in some cases.
ts-morph 235 changes
New APIs and options 2
Adds Type.prototype.isBigInt for checking whether a type is bigint.
Adds isBigIntLiteral for checking whether a type is a bigint literal.
Tooling 1
ts-morph adds support for TypeScript 5.5.
Fixes and other changes 2
Fixes removeDefaultImport when used with a type-only import.
The package is available on JSR for use in Deno.
ts-morph 227 changes
Breaking changes 2
Node.prototype.forgetDescendants() no longer returns the node itself.
ts-morph upgrades to TypeScript 5.4, which may affect TypeScript compatibility in projects using ts-morph.
New APIs and options 3
Adds support for static blocks in ClassDeclarationStructure.
Adds Type.prototype.isAssignableTo.
Adds TypeChecker.prototype.resolveName.
Fixes and other changes 2
Corrects generated method declarations so isGenerator = true writes an asterisk.
Fixes quote() so it includes newlines on newline and consistently escapes characters.
ts-morph 217 changes
Breaking changes 2
Underlying @ts-morph/common file system methods return undefined instead of throwing when a path does not exist.
Private fields are actually private, and the default build requires private fields.
New APIs and options 3
Added a wrapped TypeChecker method and a convenience method on ShorthandPropertyAssignment for getting the value symbol.
Added getters and setters for interfaces and type literals.
Added defaultCompilerOptions to ProjectOptions.
Performance 1
Uses path.exists functions that do not throw internally when a path does not exist, improving performance.
Tooling 1
Upgraded to TypeScript 5.3.
ts-morph 201 changes
Behavior and default changes 1
Supports dynamic type imports when finding referenced source files.
ts-morph 195 changes
New APIs and options 2
ExportAssignment now supports JSDocable.
A new IsVoid method was added to Type.
Behavior and default changes 1
Typing of Type was improved, which may affect how developers use its type information.
Tooling 1
The release upgraded to TypeScript 5.1.
Fixes and other changes 1
transform now works with Nodes from another parsed source file.
ts-morph 182 changes
Breaking changes 1
Upgraded to TypeScript 5.0.2, a breaking change that may affect developers using ts-morph.
Fixes and other changes 1
setType now works on binding patterns.
ts-morph 175 changes
Breaking changes 1
The project upgraded to TS 4.9, a breaking change for consumers relying on the previous TypeScript version.
New APIs and options 1
OrThrow methods now allow callers to provide custom error messages.
Fixes and other changes 3
getOverloads for a class method now takes into account whether the method is static.
ImportEqualsDeclaration can now be exported.
Named import and export specifier structures now include isTypeOnly.
ts-morph 166 changes
Breaking changes 2
Decorators are now modifiers due to TS 4.8.
Upgrades ts-morph to TypeScript 4.8, which may affect code relying on the previous TypeScript version.
Deprecations 1
The ts.createX functions are almost completely deprecated in TS 4.8; update code to use traversal.context.createX functions instead.
New APIs and options 2
Adds Type#isNever() for checking whether a type is never.
Adds Type#isReadonlyArray() for checking whether a type is a readonly array.
Fixes and other changes 1
Type#isArray() now returns true for readonly arrays.
ts-morph 1510 changes
Breaking changes 1
transform now returns a Node instead of this, because the returned node could be the replaced node.
New APIs and options 3
Traversal control now has a factory property.
Adds Node#isKind(kind) as a type guard.
Adds helper properties on TemplateLiteralTypeNode.
Tooling 1
Upgrades to TypeScript 4.7; review the changes to typescript.d.ts.
Fixes and other changes 5
Comment node type guards now handle undefined.
Deleting directories now works on Node.
Leading and trailing trivia for overloads now ends up in output.
Comments on nodes with only added synthetic leading comments now show up in transform output.
Transform now takes into account the node changing kinds.
ts-morph 142 changes
Breaking changes 2
Now returns an expression instead of a string literal.
Now represents an expression instead of a string literal.
ts-morph 1314 changes
Breaking changes 5
The target changed from ES2015 to ES2018.
Static type guard methods use Node.isX(node) instead of Node.isXNode(node), reducing verbosity.
Now returns directory entries instead of file paths.
The already deprecated TypeGuards export was removed; use Node instead.
The already deprecated WriterFunctions export was removed; use Writers instead.
New APIs and options 6
Added AssertClause.
Added AssertEntry.
Added type-only methods for ExportSpecifier.
Added type-only methods for ImportSpecifier.
More JSDoc nodes are wrapped and available through the API.
Added the Node.hasStructure type guard.
Behavior and default changes 1
The Structure.isX function was made more flexible.
Fixes and other changes 2
No longer throws an error when a decorator expression is wrapped in a parenthesized expression.
Added support for TypeScript 4.5.