Skip to content

Commit

Permalink
[Task] Adding pre commit hook to check for lint errors and fixing them (
Browse files Browse the repository at this point in the history
#26)

Co-authored-by: Mashrukh Islam <[email protected]>
  • Loading branch information
mushroomgenie and Mashrukh Islam authored Apr 10, 2024
1 parent 653de0e commit 4ca546b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 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 lint
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.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
}
},
"scripts": {
"lint": "eslint . --ext .tsx",
"lint": "eslint --fix . --ext .tsx",
"test": "node ./test/RunTests.js",
"build": "tsc && vite build && cp ./dist/index.d.ts ./dist/index.d.cts",
"prepublishOnly": "tsc && vite build && cp ./dist/index.d.ts ./dist/index.d.cts",
"prepack": "tsc && vite build && cp ./dist/index.d.ts ./dist/index.d.cts",
"start": "vite serve"
"start": "vite serve",
"prepare": "husky install"
},
"author": "tjtanjin",
"license": "MIT",
Expand All @@ -57,7 +58,8 @@
"typescript": "^5.1.6",
"vite": "^4.5.2",
"vite-plugin-dts": "^3.4.0",
"vite-plugin-svgr": "^3.2.0"
"vite-plugin-svgr": "^3.2.0",
"husky": "^8.0.0"
},
"browserslist": {
"production": [
Expand Down

0 comments on commit 4ca546b

Please sign in to comment.