Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(isolated-declarations): missing empty export when has an export declare #5925

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/oxc_isolated_declarations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ type A = string;
export function a(): A {
return ""
}

export declare const ShallowReactiveMarker: unique symbol

export type ShallowReactive<T> = T & { [ShallowReactiveMarker]?: true }
Original file line number Diff line number Diff line change
Expand Up @@ -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> = T & { [ShallowReactiveMarker]?: true };
export {};