Skip to content

Commit

Permalink
fix: when emiting declarations, always use define for class fields to…
Browse files Browse the repository at this point in the history
… work around limitations introduced in TypeScript 4.3 for when bundling declarations when a subclass overrides a property from the parent class but doesn't provide an initializer
  • Loading branch information
wessberg committed Nov 16, 2021
1 parent 1513fc5 commit b25a494
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/service/emit/declaration/emit-declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ export function emitDeclarations(options: EmitDeclarationsOptions): void {
module: typescript.ModuleKind.System,
emitDeclarationOnly: true,

// This can cause TS2612 errors that wouldn't otherwise happen
useDefineForClassFields: false,

// Never allow these options for bundled declarations
composite: false,
incremental: false,
Expand Down

0 comments on commit b25a494

Please sign in to comment.