Skip to content

Commit 0b48186

Browse files
committed
fix(formatter): add space after readonly in TSPropertySignature (#13747)
`tasks/coverage/typescript/tests/cases/conformance/types/uniqueSymbol/uniqueSymbols.ts` line 95: ``` interface I { readonly readonlyType: unique symbol; } ``` would be formatted to: ``` interface I { readonlyreadonlyType: unique symbol } ```
1 parent 50e6e3c commit 0b48186

File tree

1 file changed

+2
-2
lines changed
  • crates/oxc_formatter/src/write

1 file changed

+2
-2
lines changed

crates/oxc_formatter/src/write/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,10 +1550,10 @@ impl<'a> FormatWrite<'a> for AstNode<'a, TSInterfaceBody<'a>> {
15501550
impl<'a> FormatWrite<'a> for AstNode<'a, TSPropertySignature<'a>> {
15511551
fn write(&self, f: &mut Formatter<'_, 'a>) -> FormatResult<()> {
15521552
if self.readonly() {
1553-
write!(f, "readonly")?;
1553+
write!(f, ["readonly", space()])?;
15541554
}
15551555
if self.computed() {
1556-
write!(f, [space(), "[", self.key(), "]"])?;
1556+
write!(f, ["[", self.key(), "]"])?;
15571557
} else {
15581558
write!(f, self.key())?;
15591559
}

0 commit comments

Comments
 (0)