diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index de73c6fef1182..3fed04d727098 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -2833,6 +2833,9 @@ impl Gen for AccessorProperty<'_> { if self.computed { p.print_ascii_byte(b']'); } + if self.definite { + p.print_ascii_byte(b'!'); + } if let Some(type_annotation) = &self.type_annotation { p.print_colon(); p.print_soft_space(); diff --git a/crates/oxc_codegen/tests/integration/ts.rs b/crates/oxc_codegen/tests/integration/ts.rs index d2370bf9833ca..fd09b9c8070e5 100644 --- a/crates/oxc_codegen/tests/integration/ts.rs +++ b/crates/oxc_codegen/tests/integration/ts.rs @@ -32,6 +32,7 @@ fn cases() { test_same("class C extends B {\n\toverride show(): void;\n\toverride hide(): void;\n}\n"); test_same("class D extends B {\n\toverride readonly x: number;\n}\n"); test_same("class E {\n\tsubscribe!: string;\n}\n"); + test_same("class F {\n\taccessor value!: string;\n}\n"); test_same("export { type as as };\n"); }