Skip to content

Commit

Permalink
added husky and lint-staged for pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
luth1um committed May 31, 2024
1 parent 30fddcf commit 99bc8a6
Show file tree
Hide file tree
Showing 3 changed files with 274 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"

npx lint-staged
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"format": "prettier --write \"./**/*.{css,scss,html,js,mjs,json,md,ts}\"",
"e2e": "ng e2e",
"cypress:open": "cypress open",
"cypress:run": "cypress run"
"cypress:run": "cypress run",
"prepare": "husky"
},
"private": true,
"dependencies": {
Expand Down Expand Up @@ -52,12 +53,14 @@
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
"gh-pages": "6.1.1",
"husky": "9.0.11",
"jasmine-core": "5.1.2",
"karma": "6.4.3",
"karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.1",
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
"lint-staged": "15.2.5",
"prettier": "3.2.5",
"rimraf": "5.0.7",
"typescript": "5.4.5",
Expand All @@ -69,5 +72,12 @@
"vite": "5.0.12",
"ip": "2.0.1",
"webpack-dev-middleware": "6.1.2"
},
"lint-staged": {
"*.{html,js,mjs,ts}": [
"prettier --write",
"eslint --fix --max-warnings 0"
],
"*.{css,scss,json,md}": "prettier --write"
}
}
Loading

0 comments on commit 99bc8a6

Please sign in to comment.