Skip to content

Commit 069f3a9

Browse files
committed
Add indentation and formatting configuration: EditorConfig, Prettier, and VS Code settings
1 parent 4e27635 commit 069f3a9

5 files changed

Lines changed: 69 additions & 1 deletion

File tree

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# EditorConfig helps maintain consistent coding styles for multiple developers
2+
# working on the same project across various editors and IDEs.
3+
# editorconfig.org
4+
5+
root = true
6+
7+
# All files
8+
[*]
9+
charset = utf-8
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
# TypeScript, JavaScript, JSON files
14+
[*.{ts,tsx,js,jsx,json}]
15+
indent_style = space
16+
indent_size = 2
17+
end_of_line = lf
18+
19+
# YAML files
20+
[*.{yml,yaml}]
21+
indent_style = space
22+
indent_size = 2
23+
24+
# Markdown files
25+
[*.md]
26+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Auto detect text files and normalize line endings to LF
2+
* text=auto
3+
4+
# TypeScript, JavaScript, JSON files
5+
*.ts text eol=lf
6+
*.tsx text eol=lf
7+
*.js text eol=lf
8+
*.jsx text eol=lf
9+
*.json text eol=lf
10+
11+
# Markdown
12+
*.md text eol=lf
13+
14+
# Shell scripts
15+
*.sh text eol=lf

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ dist
111111
.tern-port
112112

113113
# ------------- IDEs and Editors ------------- #
114-
.vscode/
114+
.vscode/*
115+
!.vscode/settings.json
115116

116117
# Stores VSCode versions used for testing VSCode extensions
117118
.vscode-test

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"trailingComma": "all",
7+
"bracketSpacing": true,
8+
"arrowParens": "avoid",
9+
"endOfLine": "lf"
10+
}

.vscode/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
{
22
"files.eol": "\n",
3+
"editor.indentSize": 2,
4+
"editor.tabSize": 2,
5+
"editor.insertSpaces": true,
6+
"editor.formatOnSave": true,
7+
"editor.defaultFormatter": "esbenp.prettier-vscode",
8+
"[typescript]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"[javascript]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"[json]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode"
16+
},
17+
"files.trimTrailingWhitespace": true,
18+
"files.insertFinalNewline": true,
319
"editor.codeActionsOnSave": {
420
"source.fixAll.eslint": "explicit"
521
},

0 commit comments

Comments
 (0)