Open BryceHayden opened 6 years ago
Actually maybe it has to do with the fact that I'm using a pre-push hook, instead of a pre-commit hook. I thought it wouldn't matter since husky is the one triggering things, but it looks like it does. So is there anyway to use precise-commits with a pre-push hook from husky? Also when it goes through precise-commits the outcome is different than when I go through the IDE and the eslint plugin....I think it has to do with the fact that precise-commits isn't using eslint, and I don't have any config files like .prettierrc
Thoughts?
It seems like the benefits of precise-commits is the staged changes are all that happens, on a pre-push hook you don't have any staged files, so I'd guess it doesn't know what to check. As for eslint + prettier, I'd checkout the eslint config for prettier: eslint-config-prettier (there is also one for stylelint if you use that: stylelint-config-prettier). These disable the rules which prettier will automatically handle, which makes life a bit easier for me.
As for how to get githooks other than precise-commits to work precise-commits and husky, I too am a bit lost. It seems like it can only do prettier due to its interface, which is a major disappointment, I hope the API can be expanded or even better, that I'm wrong.
First let me just say I'm excited about using precise-commits, but I think that a couple of simple examples might be useful. For example:
I'm using prettier in my project, but it is used through eslint...since prettier doesn't check for some code rules that eslint will catch, check out their docs.
Because of this, I haven't be successful in getting precise-commits to work. I have husky installed and it is triggering precise-commits. Husky is setup to run precise-commits for a pre-push hook. Husky fires, and I see precise-commits checking for modified files, but it doesn't find any.
I know that I have prettier and eslint hooked up correctly, as when I change a file in my IDE(visual studio code) the eslint plugin catches and changes the file based on my settings. But not everyone has these settings on my team so I want to make sure the pre-push hook will trigger prettier before pushing changes up to our repo. If I alter my files in Vim, so they won't get automatically fixed by my IDE, then precise-commits doesn't cause prettier to fire. I think it has to do with the fact that I'm using it through Eslint.
Directory structure:
root
Here's the content of my files:
Root package.json
Client package.json
Client .eslintrc
Command Line output
Is it possible to use precise-commits with eslint that's using prettier? Thanks.