insertSpaceBeforeTypeAnnotation doesn't work with optional parameters / properties #25155
Labels
Bug
A bug in TypeScript
Domain: Formatter
The issue relates to the built-in formatter
Help Wanted
You can do this
Milestone
This is a follow up to #19493
TypeScript Version: 2.9.2
Search Terms: insertSpaceBeforeTypeAnnotation formatter
Code
Expected behavior:
With insertSpaceBeforeTypeAnnotation=true, I'd expect this to be formatted as:
Note the whitespace (
) before the questionmark (
?
)Actual behavior:
But it gets formatted as:
Playground Link: http://www.typescriptlang.org/play/#src=function%20RGBtoHSB(param1%20%3A%20Int%2C%20param2%3F%3A%20Int%2C%20param3%3F%3A%20Int)%0D%0A{%0D%0A}%0D%0A%0D%0Ainterface%20SquareConfig%0D%0A{%0D%0A%20color%20%3A%20string%3B%0D%0A%20width%3F%3A%20number%3B%0D%0A}
Related Issues: #19493 #20466
The text was updated successfully, but these errors were encountered: