Start your .editorconfig
file with this:
root = true
[*]
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
indent_style = tabs
The formatting tool
prettier
adjust auto-formatting styles according to.editorconfig
but ignores some attributes. This includesinsert_final_newline
which is hard-coded totrue
. See prettier issue #6360
Please ensure you are not settinginsert_final_newline
in any of your language specific settings.
And add any additional types you need from below, making sure to separate each section with a new line.
Using nixfmt-rfc-style
[*.nix]
indent_size = 2
indent_style = space
Using pycodestyle
[*.{py,py3}]
indent_size = 4
indent_style = space
Using prettier
[*.{cjs,mjs,js,ts,jsx,tsx}]
indent_size = 2
Using cargo fmt
[*.rs,Cargo.toml]
indent_size = 4
Using gofmt
[*.{go,mod}]
indent_size = 4
[*.{c,cpp,cs,h,hpp,C,H,cxx,hxx}]
indent_size = 4
[*.{sln,csproj,vbproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2
[*.{sh,zsh,bash,bat,cmd,ps1,psm1}]
indent_size = 4
[*.md]
indent_size = 2
trim_trailing_whitespace = false
[*.{htm,html,less,svg,vue}]
indent_size = 2
[*.{css.sass,scss,less}]
indent_size = 2
[*.{json,json5,webmanifest}]
indent_size = 2
[*.{yaml,yml}]
indent_style = space
indent_size = 2
[*.toml]
indent_style = unset
indent_size = 0
[.*rc]
indent_size = 2
[*.csv]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_size = 0
indent_style = unset
[*.lock]
indent_style = unset
insert_final_newline = unset
[*.{diff,patch}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_size = unset
indent_style = unset
[.{gitignore,gitreview,gitmodules}]
indent_style = unset
indent_size = 0
[*.{asc,key,ovpn,pem}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
[Makefile]
indent_size = 2