Skip to content

Commit ed3b50f

Browse files
committed
add prettier precommit hook
1 parent 636f334 commit ed3b50f

File tree

3 files changed

+208
-4
lines changed

3 files changed

+208
-4
lines changed

lib/templates/netlifyFunction.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ exports.handler = (event, context, callback) => {
3434
// When running on netlify, the header "host" is not set in
3535
// multiValueHeaders so we manually set it here.
3636
// TO-DO: @lindsaylevine/@cassidoo remove after netlify supports internally
37-
if(!event.multiValueHeaders.hasOwnProperty('host')) {
38-
event.multiValueHeaders['host'] = [event.headers['host']]
37+
if (!event.multiValueHeaders.hasOwnProperty("host")) {
38+
event.multiValueHeaders["host"] = [event.headers["host"]];
3939
}
4040

4141
// Get the request URL

package-lock.json

Lines changed: 200 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"devDependencies": {
4040
"cypress": "^5.1.0",
4141
"folder-hash": "^3.3.3",
42+
"husky": "^4.3.0",
4243
"jest": "^26.4.2",
4344
"netlify-cli": "^2.61.0",
4445
"next": "^9.5.3",
@@ -52,5 +53,10 @@
5253
"commander": "^6.0.0",
5354
"fs-extra": "^9.0.1",
5455
"next-aws-lambda": "^2.5.0"
56+
},
57+
"husky": {
58+
"hooks": {
59+
"pre-commit": "npm run format"
60+
}
5561
}
5662
}

0 commit comments

Comments
 (0)