Aller au contenu
login
arrow_backRetour aux issues
Rahul-pamula/Open_Source_Scout #9

Add pre-commit validation (Husky/lint-staged)

ecoDébutant good first issue type:devex

descriptionDescription

## Problem It's easy to accidentally commit unformatted or broken code. We want to catch linting errors before a commit is finalized. ## Goal Add pre-commit validation using Husky and lint-staged. ## Where to Look - `package.json` ## Suggested Approach 1. Install `husky` and `lint-staged`. 2. Initialize Husky. 3. Configure lint-staged in `package.json` to run `eslint` and `prettier` on staged files. ## Acceptance Criteria - [ ] Husky is initialized. - [ ] `lint-staged` is configured for `.ts` and `.tsx` files. - [ ] Attempting to commit a poorly formatted file automatically formats it or blocks the commit. ## Testing Stage a file with a linting error, run `git commit`, and verify that Husky stops the commit. ## Difficulty `Beginner`
codeOuvre sur GitHub