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
Error: fatal: Not a git repository #170
Comments
Did you see https://github.com/okonet/lint-staged#working-from-a-subdirectory? What's your config? |
Ah, I think I put that |
FWIW, I'm still getting this error, even with the
|
Try calling prettier as npm script |
There is an open issue re this |
What is the open issue? |
Could you also clarify on what you mean by "try calling prettier as npm script"? |
You can wait till this is merged or update you config like it's said in the linked issue to this PR |
Hi ! I do have the exact same problem : Trying to setup prettier on an (angular) Typescript project.
Did you manage to solve this @tnguyen14 ? |
Also a wrong config. See https://github.com/okonet/lint-staged#working-from-a-subdirectory |
@okonet I've added the Is the problem coming from a missing "linters" property ? I don't really understand why I would need that and how to use it. Maybe I'm missing some context here (https://github.com/okonet/lint-staged#working-from-a-subdirectory). Can you help me figure that out please ? |
It's all in the readme: https://github.com/okonet/lint-staged#advanced-config-format |
@maxime1992
|
@MJ111 this won't work. You need to use advanced config with |
oh. I didn't know about that. thanks |
That's why I encourage people to read the README when something isn't working :) |
you should write like this:
this project will check if 'gitDir' option first, then 'linters' |
I am still getting the error
This is my package.json
The I also tried the old syntax with |
@yiochen Could you please share the debug output? You can enable it by changing your |
@sudo-suhas looks like the precommit passed. It was the postcommit that threw the error. I checked my .git folder, and the hooks are installed correctly.
|
Mine works:
|
I am facing the same issue as @yiochen, postcommit fails with the same error, my project is inside a repo that contains backend, front end and test automation code so I can't put a package.json at the root.
The log ends with
|
Is there any reason to think that the failure in post commit hook is related to |
When trying to use
lint-staged
andhusky
in a project where the actual node.js project is a child directory of the git repo (as shown below):I get the following error:
When running
npm run precommit
, I see a lot of these errorsThe text was updated successfully, but these errors were encountered: