max-mapper / standard-format

converts your code into Standard JavaScript Format
264 stars 59 forks source link

Deleting newline character from backticked string #163

Closed xavdid closed 8 years ago

xavdid commented 8 years ago

Bear with me- I'm new to standard. I'm using standard-format in conjunction with the sublime extension to run it on save.

My file is something like this:

let line = `This should include a break\n`

which gets formatted as

let line = `This should include a break
`

which removed the explicit newline character. While it still works it's a lot less clear. Is this intended behavior or is there a way around this besides

let line = `This should include a break` + "\n"`

which sort of defeats the point. Thanks!

feross commented 8 years ago

This should not happen. PR welcome to fix it!

xavdid commented 8 years ago

After much digging, it turns out it's an open bug with babel (and by extension esformatter). The fix will trickle down to y'all once versions have been updated.

See https://github.com/millermedeiros/esformatter/issues/414 and https://phabricator.babeljs.io/T6833

feross commented 8 years ago

Cool, will close this then.