fix(codegen): output newline after export default interface (#25487)

This commit is contained in:
overlookmotel authored and GitHub committed 2026-08-11 08:01:54 +00:00
1 parent 2fe0a0dfd4
commit b4e6a9e717
2 files changed
+9 -1

No files matched your search

+4 -1
View File
@@ -1275,7 +1275,10 @@ impl Gen for ExportDefaultDeclarationKind<'_> {
class.print(p, ctx);
p.print_soft_newline();
}
Self::TSInterfaceDeclaration(interface) => interface.print(p, ctx),
Self::TSInterfaceDeclaration(interface) => {
interface.print(p, ctx);
p.print_soft_newline();
}
_ => {
p.start_of_default_export = p.code_len();
self.to_expression().print_expr(p, Precedence::Comma, Context::empty());
@@ -55,6 +55,11 @@ fn cases() {
test_same("const Bar = class<T,> {};\n");
}
#[test]
fn export_default_interface() {
test_same("export default interface X {}\nconst y = 1;\n");
}
#[test]
fn decorators() {
test_same("@a abstract class C {}\n");