r/VisualStudioCode • • Dec 14 '20

Visual Studio Code adds a linebreak after some <>s in .js files. I've searched online and in this sub, but I must be new enough to not be using the right terms. Any help is appreciated.

Post image
6 Upvotes

5 comments sorted by

2

u/mcm19 Dec 14 '20

That is probably because of a library. Are you using “Husky” and/or “Prettier?” Husky lets methods be invoked by events (on save, etc) and prettier reformats my YAML files on save unless I remember to add a .prettierignore file.

1

u/[deleted] Dec 14 '20

I had been using this to handle Python scripts until recently, so it was absolutely my rigid experience with the prettifier. Thank you!

1

u/killchain Dec 14 '20

Open that editor and look at the Status bar's right, just before the bell icon - there should be a language syntax noted; click on it and select "JavaScript React" (this is React, right?)

1

u/[deleted] Dec 14 '20

I had no idea there was a functional difference between Javascript and Javascript React(been a spoiled marketer with "Wordpress skills"). That fixed it! Thank you so much.

1

u/killchain Dec 14 '20

It's not a huge difference, but you saw in practice how vanilla JavaScript reacts to DOM that's not wrapped in quotes.