diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..3867a0f --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npm run lint diff --git a/package.json b/package.json index c836350..fb54f66 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "format": "prettier -w .", "lint": "eslint . --config eslint.config.mjs", "build": "tsc", - "demo": "npm run dev -w demo" + "demo": "npm run dev -w demo", + "prepare": "husky" }, "devDependencies": { "@eslint/js": "^9.17.0", @@ -41,6 +42,7 @@ "eslint-plugin-astro": "^1.3.1", "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-prettier": "^5.2.1", + "husky": "^9.1.7", "prettier": "^3.4.2", "prettier-plugin-astro": "^0.14.1", "typescript": "^5.7.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4e5d85c..609d7d9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,6 +42,9 @@ importers: eslint-plugin-prettier: specifier: ^5.2.1 version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.17.0))(eslint@9.17.0)(prettier@3.4.2) + husky: + specifier: ^9.1.7 + version: 9.1.7 prettier: specifier: ^3.4.2 version: 3.4.2 @@ -1414,6 +1417,11 @@ packages: http-cache-semantics@4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + husky@9.1.7: + resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} + engines: {node: '>=18'} + hasBin: true + ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -4037,6 +4045,8 @@ snapshots: http-cache-semantics@4.1.1: {} + husky@9.1.7: {} + ignore@5.3.2: {} import-fresh@3.3.0: