Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

editorconfig for Visual studio code

My project has .editorconfig file with:

[*.{js}]
charset = utf-8
indent_style = space
indent_size = 4

I thought this will force my VS Code to use indent style space with 4 spaces.

I installed EditorConfig for vs code extension from the list of extensions.

But still nothing, my newly created files don't set automatically the configured space style. What is the problem?

like image 491
croraf Avatar asked Nov 17 '17 18:11

croraf


People also ask

How do I open Visual Studio EditorConfig code?

editorconfig with rightclick on the folder structure sidebar in VSCode and select Generate . editorconfig (thus letting the plugin to create it) it works.

What is EditorConfig file Visual Studio?

In Visual Studio for Mac, you can add an EditorConfig file to your project or solution to enforce consistent coding styles for everyone that works in the codebase. The settings declared in the EditorConfig file take precedence over global Visual Studio for Mac text editor settings.

Should I commit EditorConfig?

editorconfig to GitHub or not? It depends. If the files are specific to your project, then it is appropriate to commit them. If they are appropriate for your work flow, then it is not.


2 Answers

I think I found the solution. When I create the .editorconfig with rightclick on the folder structure sidebar in VSCode and select Generate .editorconfig (thus letting the plugin to create it) it works.

Click on the empty area below the files:

enter image description here

like image 103
croraf Avatar answered Oct 10 '22 11:10

croraf


try

root = true
[*.js]
indent_style = space
indent_size = 4
charset = utf-8
like image 34
londox Avatar answered Oct 10 '22 11:10

londox