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, });