Skip to content

Commit e497e76

Browse files
CopilotYunchuWang
andcommitted
Add pre-commit hook to run lint on staged files
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
1 parent a648d28 commit e497e76

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"packages/*"
88
],
99
"scripts": {
10+
"prepare": "husky install",
1011
"build": "npm run build --workspaces",
1112
"build:core": "npm run build -w @microsoft/durabletask-js",
1213
"build:azuremanaged": "npm run build -w @microsoft/durabletask-js-azuremanaged",
@@ -52,11 +53,15 @@
5253
"grpc-tools": "^1.13.1",
5354
"husky": "^8.0.1",
5455
"jest": "^29.5.0",
56+
"lint-staged": "^15.2.7",
5557
"nodemon": "^3.1.4",
5658
"prettier": "^2.4.0",
5759
"pretty-quick": "^3.1.3",
5860
"ts-jest": "^29.1.0",
5961
"ts-node": "^10.9.1",
6062
"typescript": "^5.0.4"
63+
},
64+
"lint-staged": {
65+
"*.{js,jsx,ts,tsx}": "eslint"
6166
}
6267
}

0 commit comments

Comments
 (0)