Improve developer experience by automatically linting commits
Is your feature request related to a problem? Please describe.
Contributors are directed to run npm run format:fix before committing to ensure code standards are met. This is fine, but we could completely automate that step by using a tool like Husky to enforce an automatic "lint on commit" that works out of the box without additional developer setup.
Describe the solution you'd like
- Given husky & a pre-commit hook are configured
- When a developer runs
git commit - Then the linter is ran on changed files only
Describe alternatives you've considered
We could let contributors remember to run npm run format:fix, which will be caught by CI.
We could use some other git hook management tool, or provide more manual instructions to setup that workflow automation.
Additional context
Husky docs.
Implementation guide for using lint-staged as a pre-commit hook with Husky.
@samayer12 I would like to work on this
Sounds good @itsarijitray , it is assigned to you. Let us know if you have any questions. Please also keep the command npm run format:fix since it is used in CI and other flows as well.
Sure. Thanks!!!
PR: https://github.com/defenseunicorns/pepr/pull/1160
@cmwylie19 @samayer12
fixed and merged thanks @itsarijitray