Closed heshamelmasry77 closed 4 years ago
It's a pre-commit
hook, which will be executed before the actual commit. When you do a git commit
, then the hook is called and will in this case run lint-staged
. If the hooks fails (due to linting errors for example) your files will not be committed.
lint-staged
is configured with lint-staged.config.js
. Can you check that file, perhaps the files you changed aren't included in the config?
lint-staged.config.js
Hey, Thank you for coming back to me, Actually, I figured out why it is not working, the reason is that I have my VUEJS project in a subfolder in a big Laravel project. I honestly don't have a solution for it, I tried to move
"gitHooks": {
"pre-commit": "cross-env PRE_COMMIT=true lint-staged"
},
to the main project Package.json
but still it didn't work.
I am using the boilerplate on a big scale project and recently we are facing a problem of needing to run
yarn lint
before any commit we do. I looked and I found this pre-commit :But it seems that it is doesn't run or nothing happens! , maybe someone explains to me how doesn't it works?
I thought about change and add it to be like this:
"pre-commit": "yarn lint"
but also nothing happens. I use WebStom and source tree. I am expecting when I stage my files I see the lint runs automatically.this is my package json :