diff --git a/crates/oxc_semantic/src/builder.rs b/crates/oxc_semantic/src/builder.rs index 0c17738e70300..01af805d74121 100644 --- a/crates/oxc_semantic/src/builder.rs +++ b/crates/oxc_semantic/src/builder.rs @@ -1822,6 +1822,13 @@ impl<'a> SemanticBuilder<'a> { } } } + AstKind::TSExportAssignment(export) => { + // export = a; + // ^ can reference value or type + if export.expression.is_identifier_reference() { + self.current_reference_flag = ReferenceFlag::Read | ReferenceFlag::Type; + } + } AstKind::IdentifierReference(ident) => { self.reference_identifier(ident); } diff --git a/crates/oxc_semantic/tests/fixtures/typescript-eslint/export/equals3-type.snap b/crates/oxc_semantic/tests/fixtures/typescript-eslint/export/equals3-type.snap index bc10e5da2ef88..aab4be670cbc6 100644 --- a/crates/oxc_semantic/tests/fixtures/typescript-eslint/export/equals3-type.snap +++ b/crates/oxc_semantic/tests/fixtures/typescript-eslint/export/equals3-type.snap @@ -22,7 +22,14 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/export/equals3- "id": 0, "name": "Foo", "node": "TSInterfaceDeclaration", - "references": [] + "references": [ + { + "flag": "ReferenceFlag(Read | Type)", + "id": 0, + "name": "Foo", + "node_id": 11 + } + ] } ] }