Skip to content
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
6 changes: 4 additions & 2 deletions crates/oxc_codegen/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3755,11 +3755,13 @@ impl Gen for TSEnumDeclaration<'_> {
self.id.print(p, ctx);
p.print_space_before_identifier();
p.print_curly_braces(self.span, self.members.is_empty(), |p| {
for member in &self.members {
for (index, member) in self.members.iter().enumerate() {
p.print_leading_comments(member.span().start);
p.print_indent();
member.print(p, ctx);
p.print_comma();
if index != self.members.len() - 1 {
p.print_comma();
}
p.print_soft_newline();
}
});
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_codegen/tests/integration/snapshots/jsodc.snap
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export enum DefinitionKind {
*
* @example defineSomething<{ ... }>()
*/
TS = 'TS',
TS = 'TS'
}
export type TSTypeLiteral = {
/**
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_codegen/tests/integration/snapshots/minify.snap
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ interface A{a:string;"b":number;"c"():void;}
########## 25
enum A { a, 'b' }
----------
enum A {a,"b",}
enum A {a,"b"}
########## 26
module 'a'
----------
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_codegen/tests/integration/snapshots/ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ enum A { a, 'b' }
----------
enum A {
a,
'b',
'b'
}

########## 26
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ declare const variable: number;
declare enum Enum {
A = 0,
B = 1,
C = 2,
C = 2
}
export { Class, Function, variable, Enum };
Loading