diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..7a8e246e3 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +pnpm run lint +npx lint-staged diff --git a/package.json b/package.json index e2a1e9fdd..edaf14907 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,13 @@ "pnpm": ">=7" }, "scripts": { - "dev": "next dev", "build": "next build", - "start": "next start", + "dev": "next dev", "lint": "next lint", - "lint-staged": "lint-staged", + "prepare": "husky install", "prettier": "prettier --write --ignore-unknown .", "prettier:check": "prettier --check --ignore-unknown .", + "start": "next start", "test": "pnpm lint && pnpm prettier:check", "test:e2e": "playwright test" }, @@ -45,6 +45,7 @@ "eslint-config-next": "^13.4.9", "eslint-config-prettier": "^8.8.0", "eslint-plugin-unicorn": "^47.0.0", + "husky": "^8.0.3", "lint-staged": "^13.2.3", "postcss": "^8.4.25", "prettier": "^2.8.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7d0d18cd1..169c48afc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + dependencies: '@headlessui/react': specifier: ^1.7.15 @@ -66,6 +70,9 @@ devDependencies: eslint-plugin-unicorn: specifier: ^47.0.0 version: 47.0.0(eslint@8.44.0) + husky: + specifier: ^8.0.3 + version: 8.0.3 lint-staged: specifier: ^13.2.3 version: 13.2.3 @@ -1840,6 +1847,12 @@ packages: engines: {node: '>=14.18.0'} dev: true + /husky@8.0.3: + resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} + engines: {node: '>=14'} + hasBin: true + dev: true + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'}