Skip to content

Commit b9842c5

Browse files
committed
add husky and lint-staged config
1 parent 6e3ed01 commit b9842c5

File tree

6 files changed

+394
-7
lines changed

6 files changed

+394
-7
lines changed

Diff for: .husky/pre-commit

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
exec >/dev/tty 2>&1
5+
6+
npx lint-staged
7+

Diff for: .prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.next
2+
public

Diff for: .prettierrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"singleQuote": true,
33
"jsxSingleQuote": true,
4-
"arrowParens": "avoid"
4+
"arrowParens": "avoid",
5+
"endOfLine": "auto"
56
}

Diff for: package.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@
88
"open-browser-win": "start http://localhost:3010",
99
"open-browser-mac": "open http://localhost:3010",
1010
"build": "next build",
11-
"start": "next start"
11+
"start": "next start",
12+
"lint": "prettier --check .",
13+
"format": "prettier --write .",
14+
"prepare": "husky install"
15+
},
16+
"lint-staged": {
17+
"**/*.{js,jsx,ts,tsx}": [
18+
"prettier --write"
19+
]
1220
},
1321
"dependencies": {
1422
"html-entities": "^2.3.2",
@@ -20,5 +28,10 @@
2028
"react-mailchimp-subscribe": "^2.1.3",
2129
"sass": "^1.35.1",
2230
"swiper": "^8.2.2"
31+
},
32+
"devDependencies": {
33+
"husky": "^8.0.0",
34+
"prettier": "^2.7.1",
35+
"prettylint": "^1.0.0"
2336
}
2437
}

Diff for: styles/globals.scss

-2
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,3 @@ a {
8080
margin: 10% auto;
8181
align-items: center;
8282
}
83-
84-

0 commit comments

Comments
 (0)