Pre-commit hook fails because it can't find lint-staged
See original GitHub issueDescribe the bug
Pre-commit hook fails when I try to commit using GitHub Desktop.
Following is an excerpt of my package.json file
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "npm run lint"
}
This works when trying to commit using the command line and when tried using VSCode’s Git integration, but fails on GitHub Desktop.
lint-stage
is installed locally and I prefer to keep it that way.
Version & OS
Version 2.6.3 Windows 10 Home
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:8 (3 by maintainers)
Top Results From Across the Web
lint-staged not running on precommit - Stack Overflow
The way I found out it was a problem with husky and npm was because I found out that I had no pre-commit...
Read more >Getting started with Husky and Lint-staged for pre-commit hooks
The command eslint will lint the specified staged file and show any errors if the linting fails. It may seem odd that there...
Read more >Commit hooks are skipped due to PATH issues - Jira - Atlassian
At first I thought it's a problem with lint-staged or husky but ... We get many commits that fail in CI that should...
Read more >Using lint-staged, husky, and pre-commit hooks to fail fast and ...
Pre -commit checks are commonly used to run linting scripts and tests, allowing each commit to be as clean as possible. As the...
Read more >Diving into Husky and Lint-staged | Laurie on Tech
The commands you configure will run "pre-commit". As you're attempting to commit files to your project you'll see ESLint run in your terminal....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I uninstalled nvm, reinstalled node, restarted Windows and it didn’t worked. So I reinstalled GitHub Desktop and doesn’t work again. But in any other terminal I can commit with pre-commit
Same issue here, with same package.json config + nvm. Git command line works well but but with GitHub Desktop doesn’t.