Skip to content

Commit 06c3198

Browse files
committed
chore: setup prettier & VSCode settings
1 parent abefd7f commit 06c3198

File tree

5 files changed

+64
-2
lines changed

5 files changed

+64
-2
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
indent_style = space
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.{js,jsx,ts,tsx,json}]
10+
indent_size = 2
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.prettierrc.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
endOfLine: 'lf',
3+
semi: true,
4+
singleQuote: true,
5+
jsxSingleQuote: false,
6+
bracketSpacing: true,
7+
useTabs: false,
8+
tabWidth: 2,
9+
printWidth: 100,
10+
arrowParens: 'always',
11+
trailingComma: 'all',
12+
};

.vscode/settings.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"files.eol": "\n",
3+
"editor.renderWhitespace": "boundary",
4+
"editor.defaultFormatter": "esbenp.prettier-vscode",
5+
"editor.formatOnSave": true,
6+
"javascript.preferences.quoteStyle": "single",
7+
"typescript.preferences.quoteStyle": "single",
8+
"[javascript]": {
9+
"editor.tabSize": 2,
10+
"editor.rulers": [100],
11+
"editor.codeActionsOnSave": {
12+
"source.fixAll.eslint": true
13+
}
14+
},
15+
"[typescript]": {
16+
"editor.tabSize": 2,
17+
"editor.rulers": [100],
18+
"editor.codeActionsOnSave": {
19+
"source.fixAll.eslint": true
20+
}
21+
},
22+
"[typescriptreact]": {
23+
"editor.tabSize": 2,
24+
"editor.rulers": [100],
25+
"editor.codeActionsOnSave": {
26+
"source.fixAll.eslint": true
27+
}
28+
}
29+
}

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@
1818
]
1919
},
2020
"scripts": {
21-
"prepare": "husky install"
21+
"prepare": "husky install",
22+
"format": "prettier --check .",
23+
"format:fix": "prettier --write ."
2224
},
2325
"devDependencies": {
2426
"@commitlint/cli": "^16.2.4",
2527
"@commitlint/config-conventional": "^16.2.4",
26-
"husky": "^7.0.4"
28+
"husky": "^7.0.4",
29+
"prettier": "^2.6.2"
2730
}
2831
}

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,11 @@ path-type@^4.0.0:
904904
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
905905
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
906906

907+
prettier@^2.6.2:
908+
version "2.6.2"
909+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032"
910+
integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==
911+
907912
punycode@^2.1.0:
908913
version "2.1.1"
909914
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"

0 commit comments

Comments
 (0)