mirror of
https://github.com/aphrody-labs/oxc.git
synced 2026-10-15 06:39:17 +00:00
fix(codegen): output newline after export default interface (#25487)
This commit is contained in:
1 parent
2fe0a0dfd4
commit
b4e6a9e717
2 files changed
+9
-1
No files matched your search
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user