Skip to content

Commit 41d8e9d

Browse files
authored
fix(parser): ExportNamedDeclaration.exportKind should be type for declare declaration (#10389)
Retry for #10387
1 parent a83148c commit 41d8e9d

File tree

3 files changed

+2
-124
lines changed

3 files changed

+2
-124
lines changed

crates/oxc_codegen/src/gen.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,11 +1014,6 @@ impl Gen for ExportNamedDeclaration<'_> {
10141014
p.add_source_mapping(self.span);
10151015
p.print_indent();
10161016
p.print_str("export");
1017-
if self.export_kind.is_type()
1018-
&& !self.declaration.as_ref().is_some_and(oxc_ast::ast::Declaration::is_type)
1019-
{
1020-
p.print_str(" type ");
1021-
}
10221017
if let Some(decl) = &self.declaration {
10231018
p.print_hard_space();
10241019
match decl {

crates/oxc_parser/src/js/module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ impl<'a> ParserImpl<'a> {
363363
self.ctx = self.ctx.union_ambient_if(modifiers.contains_declare());
364364

365365
let declaration = self.parse_declaration(decl_span, &modifiers)?;
366-
let export_kind = if declaration.is_type() {
366+
let export_kind = if declaration.declare() || declaration.is_type() {
367367
ImportOrExportKind::Type
368368
} else {
369369
ImportOrExportKind::Value

0 commit comments

Comments
 (0)