Enhancement/husky for auto lint on commit#26
Merged
Jamesllllllllll merged 3 commits intomainfrom Dec 28, 2024
Merged
Conversation
aedwardg
approved these changes
Dec 28, 2024
Collaborator
aedwardg
left a comment
There was a problem hiding this comment.
LGTM. If we run into too many people struggling with it, we can always change over to a pre-push hook instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What issue is this solving?
Closes #15
Description
--fixwith ES Lint and--writewith Prettier to fix lint errors (if possible) and formatting, respectively.Notes
✔️ Run
npm ito install Husky and Lint-StagedLinting or formatting error messages may not be developer-friendly
Solution: Added
CONTRIBUTING.mdto describe how staged files are checked for linting and formatting errors, and to look for the errors if the commit is blocked.Here is how it appears to me using VS Code on Windows. I tested a commit with a lint error and get this popup:
Click "Open Git Log":
This may be a hurdle for some newbie devs. Since there may not be a one-size-fits-all solution, the documentation in CONTRIBUTING.md will help devs understand pre-commit checks.
Please make sure you've attempted to meet the following coding standards