teambtcmap / btcmap.org

Free and open source bitcoin map web application
https://btcmap.org
GNU Affero General Public License v3.0
41 stars 10 forks source link

feat: add husky for git hooks #31

Closed thebrandonlucas closed 1 year ago

thebrandonlucas commented 1 year ago

A description of the changes proposed in the pull request

Adds the husky dependency with automated prettier formatting for consistency and increased maintainability. This can easily be extended to include any scripts we want to run prior to committing (such as ESLint, tests, or Typescript checks if we choose to add)

Screen Shot 2022-09-23 at 3 35 51 PM
netlify[bot] commented 1 year ago

Deploy Preview for btcmap ready!

Name Link
Latest commit 91100e552463efd2a76a2d59c1520d8e0393b834
Latest deploy log https://app.netlify.com/sites/btcmap/deploys/6333050e195d7f0008061be4
Deploy Preview https://deploy-preview-31--btcmap.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

secondl1ght commented 1 year ago

I checked out Husky and it looks good - one thing, can you change npm run format to yarn format in the pre-commit hook because we use yarn and not npm on this project. Great idea to add this! I didn't want to add anything too heavy for something that can be done with a simple command but this seems to be a very lightweight package.

thebrandonlucas commented 1 year ago

I checked out Husky and it looks good - one thing, can you change npm run format to yarn format in the pre-commit hook because we use yarn and not npm on this project. Great idea to add this! I didn't want to add anything too heavy for something that can be done with a simple command but this seems to be a very lightweight package.

Done! Thanks for the catch.

thebrandonlucas commented 1 year ago

I checked out Husky and it looks good - one thing, can you change npm run format to yarn format in the pre-commit hook because we use yarn and not npm on this project. Great idea to add this! I didn't want to add anything too heavy for something that can be done with a simple command but this seems to be a very lightweight package.

I definitely hear you about not wanting to add dependencies; what's interesting about husky is that it can help a lot with maintainability. If/when we want to add unit tests, Eslint, or Typescript checks (for example), we could do all of that on each commit and have a lot higher code quality/consistency.

secondl1ght commented 1 year ago

@thebrandonlucas sorry I just checked this PR and realized the email notifications were going to my junk folder for some reason!! 😕 Will merge later today! ❤️

thebrandonlucas commented 1 year ago

@thebrandonlucas sorry I just checked this PR and realized the email notifications were going to my junk folder for some reason!! 😕 Will merge later today! ❤️

No worries :)