Skip to content

Commit

Permalink
chore(dx): add pre-commit hook to format code
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelovicentegc committed Nov 28, 2023
1 parent 57fca3c commit 7fd0d83
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run fmt
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"prettier": "^3.1.0",
"semantic-release": "^22.0.8",
"ts-node": "^10.8.0",
"typescript": "^5.0.0"
"typescript": "^5.0.0",
"husky": "^8.0.0"
},
"scripts": {
"semantic-release": "semantic-release",
Expand All @@ -36,7 +37,8 @@
"test": "echo \"No test specified, please create tests.\" && exit 0",
"build": "tsc",
"fmt": "prettier --write .",
"prettier:check": "prettier --check ."
"prettier:check": "prettier --check .",
"prepare": "husky install"
},
"author": "It's not you it's me",
"license": "ISC"
Expand Down

0 comments on commit 7fd0d83

Please sign in to comment.