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
chore: add lint-staged
for running the lint & test scripts
#1349
Conversation
.husky/pre-push
Outdated
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install lint-staged |
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.
Why pre-push? Why isn't pre-commit sufficient?
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.
pre-push
provides another layer of validation ?
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.
But there is nothing that pre-push can catch that pre-commit doesn't? Is there? You can't push something that's not commited. Or am I missing something?
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.
Agreed, pre-push
does nothing special than pre-commit
but I personally use it everywhere, so it was a opinionated opinion I guess 😉
- Fixed in f1a4d5e
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
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
…1349) * chore(husky): add `pre-push` hook * feat: add `lint-staged` for running scripts * style: fix lint issue * chore: remove lint-staged as devDep * fix: remove pre-push hook Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
…1349) * chore(husky): add `pre-push` hook * feat: add `lint-staged` for running scripts * style: fix lint issue * chore: remove lint-staged as devDep * fix: remove pre-push hook Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
…1349) * chore(husky): add `pre-push` hook * feat: add `lint-staged` for running scripts * style: fix lint issue * chore: remove lint-staged as devDep * fix: remove pre-push hook Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
npm run lint
& thenpm run test
scripts run only when the.js
or.ts
files are staged for pushingpre-push
git hook to run lint-staged on the staged files