Stop vs Code Wrapping HTML
This post is more than 18 months old. Since technology changes too rapidly, this content may be out of date (but
that's not always the case). Please remember to verify any technical or programming information with the current
release.
I already have Prettier and ESLint set up and they handle all of my Javascript code perfectly. But what about when you’re working on just a plain HTML file in VSCode? How do you get it to stop randomly breaking your lines?
It’s not random - it’s actually the line length to wrap by default according to the suggestion of VSCode. Still didn’t make me happy.
Turns out the setting is pretty easy. Just add the following to your settings.json
file:
"html.format.wrapLineLength": 0
This will turn off the formatting in the editor for your HTML line lengths. Yay!