declare function acceptsSuperhero(superhero: { name: `Super${string}` }): unknown;
acceptsSuperhero(1); // Argument of type 'number' is not assignable to parameter of type '{ name: `Super${string}`; }'. ts(2345)
Bug description
Currently, the backticks in the type '{ name: `Super${string}`; }' are not escaped when it is interpolated in the translation of the error message. They are instead interpreted as delimiters for inline code fences which messes up the display of the type in the error translation.
Expected behaviour
The types passed to the error message translations should be entirely escaped so that they are rendered properly.
Proposed fix
Maybe, one could reuse/reimplement the code from pretty-ts-errors to not only fix this issue, but also add syntax colouring to the types in the error translations. (See screenshot above.)
Example code
Bug description
Currently, the backticks in the type
'{ name: `Super${string}`; }'
are not escaped when it is interpolated in the translation of the error message. They are instead interpreted as delimiters for inline code fences which messes up the display of the type in the error translation.Expected behaviour
The types passed to the error message translations should be entirely escaped so that they are rendered properly.
Proposed fix
Maybe, one could reuse/reimplement the code from pretty-ts-errors to not only fix this issue, but also add syntax colouring to the types in the error translations. (See screenshot above.)