When trying to answer this question, I noticed that prettier does not seem to work well when the language lang-tsx is set on Stackoverflow.
It keeps turning
const ref = useRef<SVGPathElement>(null)
into
const ref = useRef < SVGPathElement > null
When setting the language to either lang-typescript or lang-ts, it formats it correctly.
lang-tsx seems to be a valid specifier according to the guide, and does highlight the syntax correctly.