Skip to content

Commit 3b856bd

Browse files
feat: setup Prettier formatting with precommit hooks
- Add Prettier configuration with modern best practices - Configure husky for git hooks with pre-commit formatting - Set up lint-staged to format only staged files - Add npm scripts for formatting and checking - Integration with existing ESLint setup Co-authored-by: Netanel Gilad <netanelgilad@users.noreply.github.com>
1 parent 1a05b41 commit 3b856bd

File tree

5 files changed

+779
-143
lines changed

5 files changed

+779
-143
lines changed

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Dependencies
2+
node_modules/
3+
package-lock.json
4+
yarn.lock
5+
6+
# Build output
7+
dist/
8+
build/
9+
coverage/
10+
11+
# Logs
12+
*.log
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
17+
# Environment files
18+
.env
19+
.env.local
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
24+
# Editor files
25+
.vscode/
26+
.idea/
27+
*.swp
28+
*.swo
29+
30+
# OS generated files
31+
.DS_Store
32+
.DS_Store?
33+
._*
34+
.Spotlight-V100
35+
.Trashes
36+
ehthumbs.db
37+
Thumbs.db
38+
39+
# Git
40+
.git/
41+
.gitignore

.prettierrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"quoteProps": "as-needed",
8+
"jsxSingleQuote": true,
9+
"trailingComma": "es5",
10+
"bracketSpacing": true,
11+
"bracketSameLine": false,
12+
"arrowParens": "avoid",
13+
"endOfLine": "lf"
14+
}

0 commit comments

Comments
 (0)