-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Pre commit auto prettier #1477
base: master
Are you sure you want to change the base?
Pre commit auto prettier #1477
Conversation
🦋 Changeset detectedLatest commit: eee9037 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Looks like you went with part of Option 1 here, why didn't you go for lint-staged in the end? |
packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap
Outdated
Show resolved
Hide resolved
dbd8f74
to
94ae350
Compare
I didn't really see it; let's try that out first before merging this. |
I usually use |
After you run
git commit -m "message"
, the hook kicks in and runsprettier --write
against all files going into the commit (so long as there's no conflicts against the unstaged changes).See Option 4 here: https://prettier.io/docs/en/precommit.html#option-4-git-format-stagedhttpsgithubcomhallettjgit-format-staged
And a blog post with further info https://www.olioapps.com/blog/automatic-code-formatting