I've been researching option three of this document:
My goal is to run prettier on commit.
The thing is, the root directory of my project looks like this:
root/
.git/
...
subdir/
directory_with_javascript/
.prettierrc.json
...
I haven't been able to find an example anywhere that explains how to run pre-commit in a subdirectory. I've tried a bunch of things like setting up pre-commit in the subdirectory, but when I commit, it says it can't find the .pre-commit-config.yaml
file. And if I put it at the root, it complains about not being able to find code to pretty-ify.
Can someone show me an example of using pre-commit to run prettier in a subdirectory?