Is it possible to ignore/exclude file/folder from .editorconfig?
Reason: I have a /vendor
folder with third party files. I don't want the folder to inherit any of my .editorconfig
configs.
I found the EditorConfig-Properties page and seems like there's no property to exclude folders. Maybe there's a hack to make it possible?
current config
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
Under Virus & threat protection settings, select Manage settings, and then under Exclusions, select Add or remove exclusions. Select Add an exclusion, and then select from files, folders, file types, or process. A folder exclusion will apply to all subfolders within the folder as well.
Disable EditorConfig supportPress Ctrl+Alt+S to open the IDE settings and select Editor | Code Style. Clear the Enable EditorConfig support checkbox. Apply the changes and close the dialog.
The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems.
editorconfig file at the root of your repo or in the directory that your project resides. Visual Studio looks for a file named . editorconfig in the directory of the opened file and in every parent directory.
Another solution to ignore /vendor
folder:
unset
to property you want to ignoreFor example, if you have:
You can match all files in the vendor
directory in your .editorconfig
and ignore all properties (set to IDE's default):
# top-most EditorConfig file root = true # Ignore paths [/vendor/**] charset = unset end_of_line = unset insert_final_newline = unset trim_trailing_whitespace = unset indent_style = unset indent_size = unset
You can create an .editorconfig
file in vender/
with a simple root = true
line.
Best way I've found is to add this to an otherwise blank .editorconfig
in the folder you want to ignore:
[*]
generated_code = true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With