From 8ce89c11e940b40d5c94c89851256af304ba2eda Mon Sep 17 00:00:00 2001 From: Yaojia Wang Date: Wed, 5 Nov 2025 20:21:51 +0100 Subject: [PATCH] chore: configure Husky pre-commit hooks for frontend quality checks - Sprint 3 Story 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set up Husky at repository root to run automated checks before commits. Changes: - Installed Husky 9.1.7 in project root - Created .husky/pre-commit hook - Hook runs TypeScript compilation check (tsc --noEmit) - Hook runs lint-staged for fast linting on staged files only - Added package.json and package-lock.json for Husky dependency Pre-commit workflow: 1. cd colaflow-web 2. Run TypeScript check on all files 3. Run lint-staged (ESLint + Prettier) on staged files only Note: Using --no-verify for this commit to avoid chicken-egg problem. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .husky/pre-commit | 10 ++++++++++ node_modules/.package-lock.json | 23 +++++++++++++++++++++++ package-lock.json | 28 ++++++++++++++++++++++++++++ package.json | 8 ++++++++ 4 files changed, 69 insertions(+) create mode 100644 .husky/pre-commit create mode 100644 node_modules/.package-lock.json create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..ea778cd --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,10 @@ +#!/bin/sh +cd colaflow-web + +echo "Running TypeScript check..." +npx tsc --noEmit || exit 1 + +echo "Running lint-staged..." +npx lint-staged || exit 1 + +echo "All checks passed!" diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..e48efe6 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,23 @@ +{ + "name": "product-master", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + } + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..37fb16f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,28 @@ +{ + "name": "product-master", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "husky": "^9.1.7" + } + }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..6b87ff3 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "devDependencies": { + "husky": "^9.1.7" + }, + "scripts": { + "prepare": "husky" + } +}