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

Setup Husky pre-commit hook #23

Closed
talentlessguy opened this issue Jul 16, 2020 · 8 comments
Closed

Setup Husky pre-commit hook #23

talentlessguy opened this issue Jul 16, 2020 · 8 comments
Assignees
Labels
tools setup Developer tools (like GitHub bots / CIs) setup

Comments

@talentlessguy
Copy link
Member

No description provided.

@talentlessguy talentlessguy added the tools setup Developer tools (like GitHub bots / CIs) setup label Jul 16, 2020
@talentlessguy talentlessguy self-assigned this Jul 16, 2020
@rocktimsaikia
Copy link
Contributor

@talentlessguy Is this issue still open? If it is can I work on it ?

@talentlessguy
Copy link
Member Author

@rocktimsaikia yes it is, made this one for myself, but it's ok if you do it.

I want to setup a pre-commit hook that would run a linter and tests before commiting

So we should make a lint npm script with eslint ./**/*/src/*.{ts,js} (or any other glob to match all ts and js code)

Also make a script to run linter and tests, e.g. pre-commit script maybe (any other name would fit)

Then, install husky, and run this script on pre commit

@rocktimsaikia
Copy link
Contributor

@talentlessguy Right. I also had the same idea. Currently, it does not have a separate script for linting so I was gonna create the script and add it to the pre-commit hook along with the test script. But I was not sure about adding the build scripts so waited for your comment before doing any more work on that

@rocktimsaikia
Copy link
Contributor

@talentlessguy For some reason, most of the tests are failing even tho I haven't even changed any of the code yet. Just running the test script alone logs a ton of failing tests. Also, I did follow the installation guide provided here so not sure what's causing the tests to fail. Can you tell what might be causing these errors ?

Screenshot_15

@talentlessguy
Copy link
Member Author

@rocktimsaikia the reason why tests fail is that I need to update the contributing guide...

try running pnpm i -r and pnpm build -r, these should work

@rocktimsaikia
Copy link
Contributor

@talentlessguy I already tried all of the command solutions. But still the same. Do I need to specifically set some env file configs to run it locally? I think some of the packages are not building upon running the build command. Probably that's why It can't find its corresponding type declarations !!

Screenshot_1

@talentlessguy
Copy link
Member Author

@rocktimsaikia try reloading TS Server (Ctrl + Shift + P -> Reload TS Server) in VS Code

@talentlessguy
Copy link
Member Author

Closed with #53 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools setup Developer tools (like GitHub bots / CIs) setup
Projects
None yet
Development

No branches or pull requests

2 participants