Editorconfig

Setup editorconfig file for most cases

.editorconfig File

# top-most EditorConfig file
root = true

# Default settings for all files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 2

# JavaScript, TypeScript, JSX, TSX files
[*.{js,jsx,ts,tsx}]
quote_type = single
max_line_length = 80

# JSON files
[*.json]
quote_type = double

# CSS, SCSS files
[*.{css,scss}]
max_line_length = 80

# HTML files
[*.{html,htm}]
max_line_length = 120

# Markdown files
[*.{md,mdx}]
trim_trailing_whitespace = false
max_line_length = off

# YAML files
[*.{yml,yaml}]
indent_style = space  # YAML requires spaces
indent_size = 2

# Shell scripts
[*.sh]
indent_style = space  # Convention for shell scripts
indent_size = 2

# Docker files
[Dockerfile]
indent_style = space
indent_size = 4

# Make files
[Makefile]
indent_style = tab  # Make requires tabs