chore: add lefthook commit hook

This commit is contained in:
tigattack
2025-09-26 00:08:38 +01:00
parent 35eb9303b1
commit 3c01c4bfb2
4 changed files with 8327 additions and 8170 deletions

View File

@@ -177,14 +177,19 @@ We welcome contributions from the community! Here's how you can get involved:
git checkout -b fix/your-bug-fix
```
4. **Install Dependencies and Setup Hooks**
```bash
npm install
npm run prepare
```
4. **Make Your Changes**
5. **Make Your Changes**
- Write clean, well-documented code
- Follow existing code style and patterns
- Add tests for new functionality
- Update documentation as needed
5. **Test Your Changes**
6. **Test Your Changes**
```bash
# Run backend tests
cd backend
@@ -195,14 +200,14 @@ We welcome contributions from the community! Here's how you can get involved:
npm test
```
6. **Commit and Push**
7. **Commit and Push**
```bash
git add .
git commit -m "Add: descriptive commit message"
git push origin feature/your-feature-name
```
7. **Create a Pull Request**
8. **Create a Pull Request**
- Go to your fork on GitHub
- Click "New Pull Request"
- Provide a clear description of your changes

12
lefthook.yml Normal file
View File

@@ -0,0 +1,12 @@
pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: >-
npx @biomejs/biome check
--write
--no-errors-on-unmatched
--files-ignore-unknown=true
--colors=off
{staged_files}
stage_fixed: true

16461
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,7 @@
"install:all": "npm install && npm run install:backend && npm run install:frontend",
"install:backend": "cd backend && npm install",
"install:frontend": "cd frontend && npm install",
"prepare": "lefthook install",
"dev:backend": "cd backend && npm run dev",
"dev:frontend": "cd frontend && npm run dev",
"dev": "concurrently \"npm run dev:backend\" \"npm run dev:frontend\"",
@@ -27,7 +28,7 @@
"@commitlint/cli": "^20.0.0",
"@commitlint/config-conventional": "^20.0.0",
"concurrently": "^8.2.2",
"husky": "^9.1.6",
"lefthook": "^1.13.4",
"lint-staged": "^15.2.10",
"markdownlint-cli": "^0.41.0",
"prettier": "^3.3.3",
@@ -35,13 +36,5 @@
},
"engines": {
"node": ">=18.0.0"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json}": [
"npx @biomejs/biome check --write"
],
"*.{md,yml,yaml,css,scss}": [
"npx @biomejs/biome format --write"
]
}
}