You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we are using lint-staged to run linter on staged files but we are lacking documentation to add lint-staged on the pre-commit hook.
We can add a code snippet in the wiki that can help contributors/devs to set up the pre-commit hook something like this:
One more thought came up to my mind. What if the user is on Windows OS?
Should we add husky to overcome this issue? We can add a pre-commit hook using husky on the prepare script. So when the user runsnpm install, husky will add a pre-commit hook.
The text was updated successfully, but these errors were encountered:
I'm a bit wary of npm install having such side effects.
prepare shouldn't have any side effects we need to worry about as a project like Gutenberg also uses it. Also using husky will make sure the pre-commit hook is being used properly. I think we should give it a try 👍🏼
By side effects, I mean npm install doing anything other than populating node_modules and writing package-lock.json. But that's also what --ignore-scripts can avoid, so if you want to add husky I'm fine with it.
Currently, we are using
lint-staged
to run linter on staged files but we are lacking documentation to addlint-staged
on thepre-commit
hook.We can add a code snippet in the wiki that can help contributors/devs to set up the
pre-commit
hook something like this:One more thought came up to my mind. What if the user is on Windows OS?
Should we add husky to overcome this issue? We can add a
pre-commit
hook using husky on theprepare
script. So when the user runsnpm install
, husky will add apre-commit
hook.The text was updated successfully, but these errors were encountered: