1

Related:

How do I Change VSCode To Indent 4 Spaces Instead Of Default 2?

Is there a way to format all src files in a project in vscode?

In:

enter image description here

the formatting is set by default to LF, but the environment (win) expects CRLF. This can be done by hand but is tedious.

Can vscode set the format to LF for all files (js, html)?

For js files, the .eslintrc.js config needed an extra rule:

  rules: {
     ...
    "linebreak-style": "windows",
  },
Sebi
  • 4,262
  • 13
  • 60
  • 116
  • 1
    extension [Command on All Files](https://marketplace.visualstudio.com/items?itemName=rioj7.commandOnAllFiles) – rioV8 Sep 28 '22 at 02:37

1 Answers1

1

the question has already been answered: How can I make all line endings (EOLs) in all files in Visual Studio Code, Unix-like?

You can also configure the EOL for that extension so new files will follow your preference. Under "Settings", type in the search bar: @lang:language-name @id:files.eol and then choose the "User" or "Workspace" tab. Example: for java it will be: @lang:java @id:files.eol

java eol configuration

Lucas
  • 11
  • 4
  • Managed to change LF to CRLF for js files in .eslintrc.js by adding `"linebreak-style": "windows",` to `rules`. `htmllintrc` also needs an `indent-style` rule – Sebi Sep 27 '22 at 20:44