You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a simple project setting moduleDetection to force which should treat each source file as a module:
import{Project,ts}from'ts-morph';constproject=newProject({compilerOptions: {module: ts.ModuleKind.ESNext,moduleDetection: ts.ModuleDetectionKind.Force,},useInMemoryFileSystem: true,});project.createSourceFile('a.ts',`const a = 'a'`);project.createSourceFile('b.ts',`const a = 'a'`);project.getPreEmitDiagnostics().forEach((diagnostic)=>{console.log(diagnostic.getMessageText());});
However, this will not work as expected and produce type errors. Here is a StackBlitz Node.js project reproducing the issue along with using the TypeScript compiler directly which works as expected.
Expected behavior
The moduleDetection compiler setting should be respected and not produce diagnostics when set to force.
The text was updated successfully, but these errors were encountered:
Describe the bug
Version: 25.0.0
To Reproduce
Create a simple project setting
moduleDetection
toforce
which should treat each source file as a module:However, this will not work as expected and produce type errors. Here is a StackBlitz Node.js project reproducing the issue along with using the TypeScript compiler directly which works as expected.
Expected behavior
The
moduleDetection
compiler setting should be respected and not produce diagnostics when set toforce
.The text was updated successfully, but these errors were encountered: