Skip to content

Commit

Permalink
chore: added husky and lint-staged to run prettier with pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
mskec committed Dec 12, 2023
1 parent 7f563e8 commit 0fe4234
Show file tree
Hide file tree
Showing 2 changed files with 12 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
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"@typescript-eslint/parser": "^6.2.1",
"chai": "^4.3.7",
"eslint": "^8.46.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"prettier": "^3.1.1",
Expand All @@ -38,7 +40,8 @@
"rollup": "rollup -c",
"clean": "rimraf ./dist",
"lint": "eslint --ext .ts .",
"build": "npm run test && npm run clean && npm run rollup"
"build": "npm run test && npm run clean && npm run rollup",
"prepare": "husky install"
},
"engines": {
"node": ">=14"
Expand Down Expand Up @@ -73,5 +76,8 @@
"bugs": {
"url": "https://github.com/yakovmeister/pdf2image/issues"
},
"homepage": "https://github.com/yakovmeister/pdf2image#readme"
"homepage": "https://github.com/yakovmeister/pdf2image#readme",
"lint-staged": {
"*.{js,ts}": ["prettier --write", "eslint --fix"]
}
}

0 comments on commit 0fe4234

Please sign in to comment.