diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..1a8f261 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +pnpm run format diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 0000000..1a8f261 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1 @@ +pnpm run format diff --git a/package.json b/package.json index ad9fd3a..50afd0c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "preview": "astro preview", "astro": "astro", "format": "prettier --check .", - "format:fix": "prettier --write --list-different ." + "format:fix": "prettier --write --list-different .", + "prepare": "husky" }, "dependencies": { "@astrojs/check": "^0.7.0", @@ -26,6 +27,7 @@ }, "packageManager": "pnpm@9.1.1", "devDependencies": { + "husky": "^9.0.11", "prettier": "^3.2.5", "prettier-plugin-astro": "^0.13.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f673b71..72798fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,6 +42,9 @@ importers: specifier: ^5.4.5 version: 5.4.5 devDependencies: + husky: + specifier: ^9.0.11 + version: 9.0.11 prettier: specifier: ^3.2.5 version: 3.2.5 @@ -1526,6 +1529,11 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} + husky@9.0.11: + resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==} + engines: {node: '>=18'} + hasBin: true + import-meta-resolve@4.1.0: resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} @@ -4507,6 +4515,8 @@ snapshots: human-signals@5.0.0: {} + husky@9.0.11: {} + import-meta-resolve@4.1.0: {} inline-style-parser@0.1.1: {}