Farsen
Farsen

Reputation: 1677

How to turn off ESlinting newline in VS code

I have an open and saved file in VS code:
Open saved file

Now if I, for an example, make this line longer by adding some in-line styles, the line is automatically formatted and broken up into multiple lines upon saving the file:
Automated multiple lines

I am not interested in this. I would like to avoid the single '>' char being on it´s own line, and the line breaking to take place after at least the double amount of characters per line. As far as I can see, this auto-formatting is happening because of ESLint which is included in the project. In the ESLint documentation ESLint documentation I can´t find any newline settings which affects this problem. And neither cant I find any settings in VS code File > Preferences > Settings which relates to it.

So how to turn off this quite annoying problem?

Upvotes: 0

Views: 5520

Answers (3)

Shibiru Ararso
Shibiru Ararso

Reputation: 1

If you are using a prettier Extension,

  1. open "Prettier - Code formatter"
  2. click the "setting" which is next to "uninstall" button, when you click you see four options. from that select "Extension setting"
  3. on 3rd step, you have 2 option "user" and "workspace". select one of them. under this find "Prettier: Print Width". when you get this, change the number like 150. by default it is 80. This is work for sure.

Upvotes: 0

Ean Soknet
Ean Soknet

Reputation: 21

I faced the sample problem, and this is helping me solve the problem. On the VSCode>file->preference->setting in the search box, searching the word with "Line Length" then change the value to whatever you want :)

Upvotes: 2

HRK44
HRK44

Reputation: 2742

I'm not sure this is due to eslint, you need to check vscode html formatter : https://code.visualstudio.com/docs/languages/html#_formatting

Upvotes: 1

Related Questions