-
-
Notifications
You must be signed in to change notification settings - Fork 934
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 husky configuration and remove needless packages #5196
Conversation
package.json
Outdated
@@ -38,25 +38,18 @@ | |||
"scripts": { | |||
"benchmark-rule": "node scripts/benchmark-rule.js", | |||
"format": "prettier . --write", | |||
"postinstall": "is-ci || husky install", | |||
"prepare": "husky install", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[note] The husky document uses prepare
instead of postinstall
:
https://typicode.github.io/husky/#/?id=install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to do something to disable hooks on the CI?
Perhaps:
# .husky/pre-commit
# ...
[ -n "$CI" ] && exit 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Fixed via 57eeb86.
I think we now don't need the CI
check for the prepare
script via is-ci
:
{
"scripts": {
"prepare": "is-ci || husky install"
}
}
If we would need it in the future, then let's install it again.
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[note] This is an old configuration.
`husky` no longer requires `pinst` and `is-ci` since v5.1.2. (see <typicode/husky@84be675>) So, this change simplifies the `husky` configuration and removes the needless packages. See also <https://typicode.github.io/husky>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! That's cleaner. I've left one comment.
There is so much hustle with |
@hudochenkov Honestly, I also don't like husky v5 so much... 😓 |
If none of the limitations are an issue for us, then I say go for it. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me.
We can shift to simple-git-hooks
when it's released.
Thank you for the feedback! 😄 |
husky
no longer requirespinst
andis-ci
since v5.1.2.(see typicode/husky@84be675)
So, this change simplifies the
husky
configuration and removes the needless packages.See also https://typicode.github.io/husky.
None.
None.