Skip to content

Commit

Permalink
feat: add husky git hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
IhsenBouallegue committed Nov 21, 2022
1 parent 2b9f1ec commit 84f71aa
Show file tree
Hide file tree
Showing 5 changed files with 27 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"

yarn pre-commit
5 changes: 5 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"pre-commit": "lint-staged"
}
}
9 changes: 9 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"*.{js,jsx,ts,tsx}": [
"eslint --fix --max-warnings=4",
"prettier --write --list-different"
],
"*.{json,css,scss,md}": [
"prettier --write --list-different"
]
}
File renamed without changes.
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
"scripts": {
"canvas": "yarn --cwd project-canvas dev",
"extender": "yarn --cwd project-extender start",
"jira": "yarn --cwd fake-jira-server start"
"jira": "yarn --cwd fake-jira-server start",
"prepare": "husky install",
"pre-commit": "lint-staged"
},
"devDependencies": {
"husky": "^8.0.0",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1"
}
}
}

0 comments on commit 84f71aa

Please sign in to comment.