rrweb icon indicating copy to clipboard operation
rrweb copied to clipboard

Pre commit auto prettier

Open eoghanmurray opened this issue 1 year ago • 4 comments

After you run git commit -m "message", the hook kicks in and runs prettier --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

eoghanmurray avatar May 15 '24 13:05 eoghanmurray

🦋 Changeset detected

Latest commit: eee9037dd4c0f9dccd2dbd85360e93d29eb1b62d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
rrweb-snapshot Patch
rrweb Patch
rrdom Patch
rrdom-nodejs Patch
rrweb-player Patch
@rrweb/types Patch
@rrweb/web-extension Patch
rrvideo Patch

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

changeset-bot[bot] avatar May 15 '24 13:05 changeset-bot[bot]

See Option 4 here: https://prettier.io/docs/en/precommit.html#option-4-git-format-stagedhttpsgithubcomhallettjgit-format-staged

Looks like you went with part of Option 1 here, why didn't you go for lint-staged in the end?

Juice10 avatar May 16 '24 15:05 Juice10

Looks like you went with part of Option 1 here, why didn't you go for lint-staged in the end?

I didn't really see it; let's try that out first before merging this.

eoghanmurray avatar May 20 '24 20:05 eoghanmurray

I usually use lint-staged + husky for my projects and have been pretty happy with it (though I do see the benefits of git-format-staged w/ partially staged files)

billyvg avatar May 21 '24 15:05 billyvg