AOSSIE-Org / AOSSIE-Org/EduAid

Add Pre-commit Hook for Linting and Formatting with Husky

Offen
#117 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
171
Forks
425
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Description:
Right now, there's nothing in place to catch linting or formatting issues before code gets committed. This means that sometimes broken or inconsistent code gets into the codebase, which leads to headaches in code reviews, CI failures, and slower development overall.

To solve this, I suggest adding a **Husky pre-commit hook** that runs **ESLint** for linting and **Prettier** for formatting checks before any code is committed. The hook will only run on **staged files**, so it will only check the changes that are actually about to be committed. This will help ensure that we don’t accidentally commit broken code or leave formatting issues behind, ultimately making the development process faster and smoother.

**Issue Type:**
- [x] Feature
- [ ] Bug
- [ ] Documentation
- [ ] Improvement
- [ ] Refactor
- [ ] Task

## Why This Is Needed:
- **Faster Development:** Catching issues before they get committed means fewer problems later on, reducing delays during code review and CI.

- **Consistent Code:** Ensures the codebase stays clean, properly formatted, and follows the same standards.

- **Avoiding Broken Code:** By running these checks only on staged files before committing, we prevent broken code from slipping through and causing issues down the line.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.