Skip to content

Commit

Permalink
fix(isolated-declarations): should emit export {} when only having …
Browse files Browse the repository at this point in the history
…`ImportDeclaration` (#4026)

close: #4023
  • Loading branch information
Dunqing committed Jul 2, 2024
1 parent 7c915f4 commit 02ea19a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
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 @@ -317,7 +317,7 @@ impl<'a> IsolatedDeclarations<'a> {
}
}

if last_transformed_len == transformed_indexes.len() {
if !transformed_indexes.is_empty() && last_transformed_len == transformed_indexes.len() {
need_empty_export_marker = false;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import * as a from "mod";
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
source: crates/oxc_isolated_declarations/tests/mod.rs
input_file: crates/oxc_isolated_declarations/tests/fixtures/empty-export2.ts
---
==================== .D.TS ====================

export {};

0 comments on commit 02ea19a

Please sign in to comment.