Skip to content

Commit

Permalink
feat: add pre-commit hooks with lint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanMorel committed Nov 9, 2023
1 parent 8d8a4fb commit 71aadad
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm ts:check
echo "Running pre-commit hook..."

pnpm ts:check && pnpx lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{ts}": ["prettier --write", "eslint"],
"*.{json}": ["prettier --write"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-security": "^1.7.1",
"husky": "^8.0.3",
"lint-staged": "^15.0.2",
"nodemon": "^3.0.1",
"prettier": "^3.0.3"
}
Expand Down
Loading

0 comments on commit 71aadad

Please sign in to comment.