-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup prettier to run on pre-commit #93
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I assume 1321332 is the only meaningful code change here.
ps. @eddiekeller this reminds me of a similar pr i made, but more intimidating 😆 aws-amplify/amplify-js#8136
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice quality-of-life improvement!
@@ -0,0 +1 @@ | |||
_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's _
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an internal husky folder
.next | ||
.husky |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does prettier not automatically ignore what's in .gitignore
? I assumed it did. TIL!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently not, it was trying to lint the .next folder
Yup, the first commit is the real change. Second is just running prettier. |
Description of changes:
This PR sets up Prettier to run on the pre-commit git hook (will run prettier on staged files right before being committed). I went with
husky
andlint-staged
to runprettier
becauselint-staged
works with ESLint which I will add in the next PR. I've also prettier-ified the entire repo. If anyone has objections to running prettier on the whole repo as opposed to running it as we change things, please let me know.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.