Describe the bug
Version: 21.0.1
To Reproduce
{
"compilerOptions": {
"module": "Node16",
"strict": true,
}
}
import * as tsMorph from 'ts-morph';
console.log(tsMorph);
{
"dependencies": {
"ts-morph": "^21.0.1",
"typescript": "^5.4.2"
}
}
Run tsc:
$ /Users/oliver/Code/typescript-playground/node_modules/.bin/tsc
node_modules/ts-morph/lib/ts-morph.d.ts:5289:127 - error TS2344: Type 'CompilerNodeToWrappedType<InstanceOf<T>["compilerNode"]>' does not satisfy the constraint 'Node<Node>'.
Type 'SourceFile | ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration | Identifier | ... 198 more ... | Node<...>' is not assignable to type 'Node<Node>'.
Type 'SourceFile' is not assignable to type 'Node<Node>'.
The types returned by 'forgetDescendants()' are incompatible between these types.
Type 'SourceFile' is not assignable to type 'CompilerNodeToWrappedType<InstanceOf<T>["compilerNode"]>'.
5289 export declare function BaseExpressionedNode<T extends Constructor<ExpressionedNodeExtensionType>, TExpression extends Node = CompilerNodeToWrappedType<InstanceOf<T>["compilerNode"]>>(Base: T): Constructor<BaseExpressionedNode<TExpression>> & T;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in node_modules/ts-morph/lib/ts-morph.d.ts:5289
Expected behavior
No type errors.
Describe the bug
Version: 21.0.1
To Reproduce
{ "compilerOptions": { "module": "Node16", "strict": true, } }{ "dependencies": { "ts-morph": "^21.0.1", "typescript": "^5.4.2" } }Run
tsc:Expected behavior
No type errors.