benjamn / recast

JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator
MIT License
4.91k stars 347 forks source link

fix: double parentheses when returning JSXElements using Babel parser #1406

Open tim-dev opened 1 month ago

tim-dev commented 1 month ago

Doing a print on a JSXElement that was parenthesized in Babel (noted via extra.parenthesized) was causing a double parentheses situation to happen, like:

return (
   (<Button>
   Text
   </Button>)
)