docs: add pre-commit hook activation instructions to README (closes #54)
This commit is contained in:
14
README.md
14
README.md
@@ -172,6 +172,20 @@ npm run lint
|
|||||||
|
|
||||||
## Git-Workflow
|
## Git-Workflow
|
||||||
|
|
||||||
|
### Pre-Commit Hooks aktivieren
|
||||||
|
|
||||||
|
Die Pre-Commit Hooks (Husky + lint-staged) werden automatisch beim Installieren der Abhängigkeiten eingerichtet:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Der `prepare`-Script in `package.json` (`"prepare": "husky"`) sorgt dafür, dass Husky die Git Hooks im `.husky/`-Verzeichnis registriert. Nach `npm install` sind die Hooks aktiv – kein manueller Schritt nötig.
|
||||||
|
|
||||||
|
> **Falls Hooks nicht laufen:** Prüfe ob `.husky/pre-commit` ausführbar ist (`chmod +x .husky/pre-commit`) und ob `core.hooksPath` nicht überschrieben wurde (`git config core.hooksPath`).
|
||||||
|
|
||||||
|
### Was wird beim Commit geprüft?
|
||||||
|
|
||||||
Beim Committen führt **Husky** automatisch den Pre-Commit Hook (`.husky/pre-commit`) aus, der **lint-staged** startet.
|
Beim Committen führt **Husky** automatisch den Pre-Commit Hook (`.husky/pre-commit`) aus, der **lint-staged** startet.
|
||||||
|
|
||||||
### lint-staged prüft automatisch:
|
### lint-staged prüft automatisch:
|
||||||
|
|||||||
Reference in New Issue
Block a user