I am trying to set up lint-staged following the instructions from the prettier documentation.
When I run npx mrm@2 lint-staged
, I get the following error:
Error: .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)
at Object.install (/home/moritz/.npm/_npx/51762936ba23ccdb/node_modules/husky/lib/index.js:20:15)
at task (/home/moritz/.npm/_npx/51762936ba23ccdb/node_modules/mrm-task-lint-staged/index.js:214:8)
at /home/moritz/.npm/_npx/51762936ba23ccdb/node_modules/mrm/src/index.js:170:20
I followed the link from the error and changed the scripts section in package.json
accordingly.
"scripts": {
"prepare": "cd .. && husky install laravel/.husky"
}
I still get the same error when running npx mrm@2 lint-staged
.
What can I do to get lint-staged running?
My project structure:
project
│ .git
└───laravel
│ package.json