Skip to content

Commit

Permalink
check-no-emit-flag (#2908)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaozha authored Nov 21, 2024
1 parent efa49e5 commit 86e49d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/typespec-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ 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
3 changes: 3 additions & 0 deletions packages/typespec-ts/src/utils/emitUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ async function emitFile(
isAzureFlavor: boolean,
emitterOutputDir?: string
) {
if (program.compilerOptions.noEmit || program.hasError()) {
return;
}
const host: CompilerHost = program.host;
const filePath = join(emitterOutputDir ?? "", file.path);
const isJson = /\.json$/gi.test(filePath);
Expand Down

0 comments on commit 86e49d0

Please sign in to comment.