Skip to content

Commit

Permalink
Add husky (#9)
Browse files Browse the repository at this point in the history
- Adds Husky – https://typicode.github.io/husky/#/
- Upon installation these adds the following git hooks:
  * yarn run lint
  * yarn run format
  • Loading branch information
fmrsabino authored Aug 8, 2022
1 parent 48af1b9 commit 143e63b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn run lint
yarn run format
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" --no-error-on-unmatched-pattern",
"format-check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\" --no-error-on-unmatched-pattern",
"start": "nest start",
"start:dev": "nest start --watch",
Expand All @@ -20,7 +20,8 @@
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
"test:e2e": "jest --config ./test/jest-e2e.json",
"postinstall": "husky install"
},
"dependencies": {
"@nestjs/axios": "^0.1.0",
Expand All @@ -45,6 +46,7 @@
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^8.0.0",
"jest": "28.1.2",
"prettier": "^2.3.2",
"source-map-support": "^0.5.20",
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3717,6 +3717,15 @@ __metadata:
languageName: node
linkType: hard

"husky@npm:^8.0.0":
version: 8.0.1
resolution: "husky@npm:8.0.1"
bin:
husky: lib/bin.js
checksum: 943a73a13d0201318fd30e83d299bb81d866bd245b69e6277804c3b462638dc1921694cb94c2b8c920a4a187060f7d6058d3365152865406352e934c5fff70dc
languageName: node
linkType: hard

"iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24":
version: 0.4.24
resolution: "iconv-lite@npm:0.4.24"
Expand Down Expand Up @@ -5791,6 +5800,7 @@ __metadata:
eslint: ^8.21.0
eslint-config-prettier: ^8.3.0
eslint-plugin-prettier: ^4.0.0
husky: ^8.0.0
jest: 28.1.2
prettier: ^2.3.2
reflect-metadata: ^0.1.13
Expand Down

0 comments on commit 143e63b

Please sign in to comment.