Skip to content
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

fix: unable to commit with ts errors in unstaged files #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

FrantisekMichalSebestyen
Copy link
Contributor

@FrantisekMichalSebestyen FrantisekMichalSebestyen commented Nov 22, 2023

stash unstaged files before type check

@FrantisekMichalSebestyen
Copy link
Contributor Author

Please check if I replicated the original behavior.
We might also want to add a check if the files are linted 🤷

@FrantisekMichalSebestyen FrantisekMichalSebestyen force-pushed the NSNG-449-fix-be-able-to-commit-with-errors-in-unstaged-files branch from ae87338 to a5bdfea Compare November 22, 2023 12:53
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run type-check
git stash -q --keep-index && npm run type-check && git stash pop -q && npx lint-staged
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of type-check error script wont continue and stash is never poped back
thats why I suggested to start with trap 'git stash pop -q' EXIT;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants