Skip to content

Scheduling infrastructure for absolutely everyone.

feat: adds git hooks and husky for pre-commit linting

Agusti Fernandez Pardo2e2f6a5e57c0
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 00000000000..025779ed2ba
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,4 @@
+#!/bin/sh
+. "$(dirname "$0")/_/husky.sh"
+
+yarn pre-commit
diff --git a/package.json b/package.json
index 496c86a04f6..cb8d5430657 100644
--- a/package.json
+++ b/package.json
@@ -11,9 +11,12 @@
"start": "next start",
"build": "next build",
"lint": "next lint",
+ "lint-fix": "next lint --fix",
"test": "jest --detectOpenHandles",
"type-check": "tsc --pretty --noEmit",
- "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
+ "prepare": "husky install",
+ "pre-commit": "next lint"
},
"devDependencies": {
"@babel/core": "^7.17.8",
@@ -22,9 +25,10 @@
"@calcom/prisma": "*",
"@calcom/tsconfig": "*",
"babel-jest": "^27.5.1",
+ "husky": "^7.0.4",
"jest": "^27.5.1",
"node-mocks-http": "^1.11.0",
- "typescript": "^4.5.3"
+ "typescript": "^4.6.3"
},
"dependencies": {
"next": "^12.1.0",