Add pre-commit hook to format files

This commit is contained in:
SujithPS 2023-10-28 15:36:19 +05:30
parent 1bdb878d21
commit 600c7b6801
3 changed files with 20 additions and 5 deletions

View File

@ -45,6 +45,7 @@ You will need to use the environment variables [defined in `.env.example`](.env.
1. Install Vercel CLI: `npm i -g vercel`
2. Link local instance with Vercel and GitHub accounts (creates `.vercel` directory): `vercel link`
3. Download your environment variables: `vercel env pull`
4. Install pnpm (https://pnpm.io/installation) : `curl -fsSL https://get.pnpm.io/install.sh | sh -`
```bash
pnpm install

View File

@ -13,18 +13,19 @@
"lint-staged": "lint-staged",
"prettier": "prettier --write --ignore-unknown .",
"prettier:check": "prettier --check --ignore-unknown .",
"test": "pnpm lint && pnpm prettier:check"
},
"git": {
"pre-commit": "lint-staged"
"test": "pnpm lint && pnpm prettier:check",
"prepare": "husky install"
},
"lint-staged": {
"*": "prettier --write --ignore-unknown"
"*": "prettier --write --ignore-unknown",
"*.js": "eslint --cache --fix",
"*.{js,css,md}": "prettier --write"
},
"dependencies": {
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
"clsx": "^2.0.0",
"husky": "^8.0.3",
"next": "13.5.4",
"react": "18.2.0",
"react-dom": "18.2.0"

13
pnpm-lock.yaml generated
View File

@ -1,5 +1,9 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
'@headlessui/react':
specifier: ^1.7.17
@ -10,6 +14,9 @@ dependencies:
clsx:
specifier: ^2.0.0
version: 2.0.0
husky:
specifier: ^8.0.3
version: 8.0.3
next:
specifier: 13.5.4
version: 13.5.4(react-dom@18.2.0)(react@18.2.0)
@ -1687,6 +1694,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: false
/ignore@5.2.4:
resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==}
engines: {node: '>= 4'}