Skip to content

Conversation

alexandr-g
Copy link

@alexandr-g alexandr-g commented Feb 5, 2021

Hi folks! I’ve upgraded from husky v4 to v5, and updated lint-staged. Please have a look 🙂

Let me know if there any comments regarding the pre-commit config.

If you’re curious about what’s new in Husky 5 you can find more details here - https://dev.to/typicode/what-s-new-in-husky-5-32g5

TLDR; faster and smaller, zero dependencies

Some benefits of using the newer husky version

  • Zero dependencies
  • Lightweight (~0.02MB vs ~1MB for husky 4)
  • Fast (~0.01s vs ~0.5s for husky 4)

How to test:

  1. Modify a file
  2. Stash it and commit
  3. Make sure the pre-commit hook runs as before

Let's say a file that you modified, was formatted by prettier --write, meaning lint-staged was triggered correctly.

Screen_Shot_2021-02-05_at_4_59_32_PM

References/Resources:
https://typicode.github.io/husky/#/
https://github.com/typicode/husky-4-to-5
typicode/husky#618 (comment)

@facebook-github-bot
Copy link

Hi @alexandr-g!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@JeffBaumgardt
Copy link

My only question to this is what about people who don't use yarn?

In the pre-commit you have yarn lint-staged. I don't use yarn and most (if not all) of my team uses npm.

@stale
Copy link

stale bot commented Jan 9, 2022

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants