avinashupadhya99 / Dictu-Playground

MIT License
8 stars 20 forks source link

add pre-commit hook using husky #23

Closed Diksha02 closed 3 years ago

Diksha02 commented 3 years ago

What do these changes do?

Add pre-commit and commit-msg hooks with the help of husky module

I added pre-commit and commit-msg hooks with the help of husky package and did the set-up for eslint and commitlint for the project.

Related Issue

1

Fixes #

Checklist:

Diksha02 commented 3 years ago

Hey It seems like setting up husky when package.json and .git are in different folders is too much confusing can I add a package.json to the root directory and try the same? https://github.com/okonet/lint-staged/issues/961 https://typicode.github.io/husky/#/?id=custom-directory

Diksha02 commented 3 years ago

Hey It seems like setting up husky when package.json and .git are in different folders is too much confusing can I add a package.json to the root directory and try the same? okonet/lint-staged#961 https://typicode.github.io/husky/#/?id=custom-directory

I'm not really sure though if that will work, can you look into the issue once and suggest to me what could be done?

avinashupadhya99 commented 3 years ago

Hey It seems like setting up husky when package.json and .git are in different folders is too much confusing can I add a package.json to the root directory and try the same? okonet/lint-staged#961 https://typicode.github.io/husky/#/?id=custom-directory

I'm not really sure though if that will work, can you look into the issue once and suggest to me what could be done?

Can you try using a husky config directory .husky in the root directory. Here's a reference

Diksha02 commented 3 years ago

Hey It seems like setting up husky when package.json and .git are in different folders is too much confusing can I add a package.json to the root directory and try the same? okonet/lint-staged#961 https://typicode.github.io/husky/#/?id=custom-directory

I'm not really sure though if that will work, can you look into the issue once and suggest to me what could be done?

Can you try using a husky config directory .husky in the root directory. Here's a reference

Sure, do I have to remove the husky hooks from the package.json in this case?

avinashupadhya99 commented 3 years ago

Hey It seems like setting up husky when package.json and .git are in different folders is too much confusing can I add a package.json to the root directory and try the same? okonet/lint-staged#961 https://typicode.github.io/husky/#/?id=custom-directory

I'm not really sure though if that will work, can you look into the issue once and suggest to me what could be done?

Can you try using a husky config directory .husky in the root directory. Here's a reference

Sure, do I have to remove the husky hooks from the package.json in this case?

Yes, let's have all of it in one place

Diksha02 commented 3 years ago

I will have to create a package.json in the root directory though, else the command won't work 😅 image

Diksha02 commented 3 years ago

Did the changes and tested for the same, please review and let me know!