prettier / prettier-browser-extension

Prettier Browser Extension
https://chrome.google.com/webstore/detail/prettier/fbcfnmplppajblbmdehballiekfgdkhp
MIT License
201 stars 18 forks source link

formatting errors for generics when `lang-tsx` is selected #426

Open tefkah opened 1 year ago

tefkah commented 1 year ago

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.