fix: precommit hooks. Use pnpm filtering instead of lint-staged#65
Merged
edgarkhanzadian merged 1 commit intodevfrom Feb 23, 2024
Merged
fix: precommit hooks. Use pnpm filtering instead of lint-staged#65edgarkhanzadian merged 1 commit intodevfrom
edgarkhanzadian merged 1 commit intodevfrom
Conversation
kyranjamie
reviewed
Feb 23, 2024
Comment on lines
+4
to
+7
| LATEST_HASH=$(git rev-parse --verify HEAD) | ||
|
|
||
| # Run commands only in packages with changed files compared to previous commit and on their dependants in parallel | ||
| pnpm -r --filter="...[$LATEST_HASH]" --parallel "/^format$|^lint$|^typecheck$/" |
Collaborator
There was a problem hiding this comment.
Nice, this is faster?
I'm a little skeptical of pre-commit jobs. I've tried using them in the past and it gets annoying having a delay post-commit and I end up --no-verifying relying on CI anyway
Collaborator
Author
There was a problem hiding this comment.
Not a big fan of it too but it's nice to keep the option for now. We can remove it down the road if it turns out too big a of a pain.
running with parallel recursive pnpm is faster right now, might become a bit slower than lint-staged down the road. But on the plus side, we can run tsc, which imho usually gives more info than eslint.
kyranjamie
approved these changes
Feb 23, 2024
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.
Closes #62
Some issues i had with lint-staged:
So i'm taking another approach here, run lint, format, typecheck recursively and in parallel only in those packages that have changes compared to the last commit (and on packages that are dependent on packages with changes)