Reputation: 31237
I have created a react app which implements husky to capture lint errors:
git version 2.21.0 (Apple Git-122)
, node v8.16.2
, npm v6.4.1
npx create-react-app my-app-name
eslint --init
Added the script to the package.json
file:
“scripts”: {“lint”: “eslint src/**/*.js”,}
eslint src/**/*.js
or npm run lint
the lint errors are captured perfectlynpm install husky --save-dev
Added the husky hook to package.json
:
"husky": {
"hooks": {
"pre-commit": "npm run lint:fix",
"pre-push": "npm run lint"
}
}
git commit -m "test commit"
The lint is never called when the commit is triggered. What is wrong here? Btw, I have tried solutions proposed here.
Upvotes: 0
Views: 2952
Reputation: 141
husky requires node > v10. Otherwise, it will skip with a warning message in the console.
Your node version is v8.16.2, please upgrade the same.
Upvotes: 1