Skip to content

Commit

Permalink
Disable generation if enabling noEmit flag (#2948)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaryGao authored Dec 12, 2024
1 parent fd50ff3 commit e265539
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/typespec-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ import { emitSamples } from "./modular/emitSamples.js";
export * from "./lib.js";

export async function $onEmit(context: EmitContext) {
if (context.program.compilerOptions.noEmit || context.program.hasError()) {
return;
}
/** Shared status */
const outputProject = new Project();
const program: Program = context.program;
Expand Down Expand Up @@ -299,9 +302,6 @@ export async function $onEmit(context: EmitContext) {
}

binder.resolveAllReferences(modularSourcesRoot);
if (program.compilerOptions.noEmit || program.hasError()) {
return;
}

for (const file of project.getSourceFiles()) {
file.fixMissingImports(
Expand Down

0 comments on commit e265539

Please # to comment.