From 09d8afca684635b5ac604bc1794240484a70ce91 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 18 Mar 2020 12:06:32 -0700 Subject: [PATCH] fix(typescript-estree): export * regression from 133f622f (#1751) --- packages/typescript-estree/src/convert.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 74c701b7fc4..c622e11c14f 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1602,7 +1602,12 @@ export class Converter { source: this.convertChild(node.moduleSpecifier), exportKind: node.isTypeOnly ? 'type' : 'value', exported: - node.exportClause?.kind === SyntaxKind.NamespaceExport + // note - for compat with 3.7.x, where node.exportClause is always undefined and + // SyntaxKind.NamespaceExport does not exist yet (i.e. is undefined), this + // cannot be shortened to an optional chain, or else you end up with + // undefined === undefined, and the true path will hard error at runtime + node.exportClause && + node.exportClause.kind === SyntaxKind.NamespaceExport ? this.convertChild(node.exportClause.name) : null, });