Skip to content

Instantly share code, notes, and snippets.

@firxworx
Created February 27, 2021 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save firxworx/50f3722a00b26dd9bbad210b80620c7e to your computer and use it in GitHub Desktop.
Save firxworx/50f3722a00b26dd9bbad210b80620c7e to your computer and use it in GitHub Desktop.
Generic editorconfig for web projects
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.{js,jsx,ts,tsx,json,yml,yaml,xml,html,css,sass,scss,less}]
indent_size = 2
indent_style = space
[**.min.js]
indent_style = unset
insert_final_newline = false
[*.sh]
indent_size = 2
indent_style = space
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
[*.{diff,patch}]
trim_trailing_whitespace = false
# terraform
[*.{tf,tfvars}]
indent_size = 2
indent_style = space
# python PEP8 style guide
[*.{py,py.in}]
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
max_line_length = 80
# ruby
[*.{rb,gemspec}]
indent_size = 2
# microsoft C# coding convention
[*.cs]
indent_size = 4
indent_style = space
# batch + cmd files use tab indentation
[*.{cmd,bat}]
indent_style = tab
end_of_line = crlf
# Makefiles use tab indentation
[{[Mm]akefile*,*.mak,*.mk}]
indent_style = tab
indent_size = 8
max_line_length = 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment