Skip to content

Commit

Permalink
Fix support for emitDeclarationOnly
Browse files Browse the repository at this point in the history
Closes #1716
  • Loading branch information
Gerrit0 committed Oct 2, 2021
1 parent ea0b3d7 commit f3ff7cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,7 @@

- TypeDoc will now only create one highlighter for rendering code, saving ~200-500ms for rendering time.
- For compatibility with JSDoc, TypeDoc will now strip `<caption>` elements from `@example` tags, resolves #1679.
- TypeScript's `emitDeclarationOnly` compiler option is now supported, resolves #1716.
- Fixed a crash when converting the `globalThis` namespace, could only be caused by a plugin.

### Thanks!
Expand Down
16 changes: 11 additions & 5 deletions src/lib/utils/options/options.ts
Expand Up @@ -323,11 +323,17 @@ export class Options {
}

/** @internal */
fixCompilerOptions(options: Readonly<ts.CompilerOptions>) {
return {
...options,
noEmit: !this.getValue("emit"),
};
fixCompilerOptions(
options: Readonly<ts.CompilerOptions>
): ts.CompilerOptions {
const result = { ...options };

if (!this.getValue("emit")) {
result.noEmit = true;
delete result.emitDeclarationOnly;
}

return result;
}

/**
Expand Down

0 comments on commit f3ff7cf

Please sign in to comment.