Search Terms
- isolatedModules
- noEmitOnError
Suggestion
Allow isolatedModules: true with noEmitOnError: true
Use Cases
What do you want to use this for?
My understanding of the purpose of isolatedModules: true is that it does extra validation to ensure that separate compilation is safe. We want to use it for that purpose.
Allowing emit in the presence of errors is contrary to that goal. We're doing the validation to stop dangerous code from getting through.
What shortcomings exist with current approaches?
We use TypeScript in our compilation pipeline.
The only workaround I can think of is some hack to compile to a different location and copy files over once checks pass. This doesn't seem great for watch mode, and could be error-prone or racy.
Examples
tsconfig.json:
{
"compilerOptions": {
"noEmitOnError": true,
"isolatedModules": true,
}
}
Actual behavior: tsconfig.json(5,9): error TS5053: Option 'noEmitOnError' cannot be specified with option 'isolatedModules'.
Expected behavior: no error message, just works
Checklist
My suggestion meets these guidelines:
Search Terms
Suggestion
Allow isolatedModules: true with noEmitOnError: true
Use Cases
What do you want to use this for?
My understanding of the purpose of
isolatedModules: trueis that it does extra validation to ensure that separate compilation is safe. We want to use it for that purpose.Allowing emit in the presence of errors is contrary to that goal. We're doing the validation to stop dangerous code from getting through.
What shortcomings exist with current approaches?
We use TypeScript in our compilation pipeline.
The only workaround I can think of is some hack to compile to a different location and copy files over once checks pass. This doesn't seem great for watch mode, and could be error-prone or racy.
Examples
tsconfig.json:
{ "compilerOptions": { "noEmitOnError": true, "isolatedModules": true, } }Actual behavior:
tsconfig.json(5,9): error TS5053: Option 'noEmitOnError' cannot be specified with option 'isolatedModules'.Expected behavior: no error message, just works
Checklist
My suggestion meets these guidelines: