diff --git a/crates/oxc_isolated_declarations/src/lib.rs b/crates/oxc_isolated_declarations/src/lib.rs index 64eb2fac8..fd9ca24b2 100644 --- a/crates/oxc_isolated_declarations/src/lib.rs +++ b/crates/oxc_isolated_declarations/src/lib.rs @@ -253,7 +253,7 @@ impl<'a> IsolatedDeclarations<'a> { transformed_spans.insert(decl.span); if let Some(new_decl) = self.transform_export_named_declaration(decl) { *decl = self.ast.alloc(new_decl); - } else { + } else if decl.declaration.is_none() { need_empty_export_marker = false; } self.scope.visit_export_named_declaration(decl); diff --git a/crates/oxc_isolated_declarations/tests/fixtures/empty-export.ts b/crates/oxc_isolated_declarations/tests/fixtures/empty-export.ts index 0b8a0adab..9087a1aea 100644 --- a/crates/oxc_isolated_declarations/tests/fixtures/empty-export.ts +++ b/crates/oxc_isolated_declarations/tests/fixtures/empty-export.ts @@ -2,3 +2,7 @@ type A = string; export function a(): A { return "" } + +export declare const ShallowReactiveMarker: unique symbol + +export type ShallowReactive = T & { [ShallowReactiveMarker]?: true } diff --git a/crates/oxc_isolated_declarations/tests/snapshots/empty-export.snap b/crates/oxc_isolated_declarations/tests/snapshots/empty-export.snap index bea8f064e..ab5a88919 100644 --- a/crates/oxc_isolated_declarations/tests/snapshots/empty-export.snap +++ b/crates/oxc_isolated_declarations/tests/snapshots/empty-export.snap @@ -6,4 +6,6 @@ input_file: crates/oxc_isolated_declarations/tests/fixtures/empty-export.ts type A = string; export declare function a(): A; +export declare const ShallowReactiveMarker: unique symbol; +export type ShallowReactive = T & { [ShallowReactiveMarker]?: true }; export {};