This is a follow up to #19493
TypeScript Version: 2.9.2
Search Terms: insertSpaceBeforeTypeAnnotation formatter
Code
function RGBtoHSB(param1 : Int, param2?: Int, param3?: Int)
{
}
interface SquareConfig
{
color : string;
width?: number;
}
Expected behavior:
With insertSpaceBeforeTypeAnnotation=true, I'd expect this to be formatted as:
function RGBtoHSB(param1 : Int, param2 ?: Int, param3 ?: Int)
{
}
interface SquareConfig
{
color : string;
width ?: number;
}
Note the whitespace ( ) before the questionmark (?)
Actual behavior:
But it gets formatted as:
function RGBtoHSB(param1 : Int, param2?: Int, param3?: Int)
{
}
interface SquareConfig
{
color : string;
width?: number;
}
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
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