I'm trying to use typescript pre-commit Husky hooks with LintStaged, but when I do a commit, the pre-commit script is not running, I just receive the common git response after commits.
.huskyrc.json
{
"hooks": {
"pre-commit": "lint-staged"
}
}
.lintstagedrc.json
{
"*.ts": [
"eslint 'src/**' --fix",
"npm run test:staged"
]
}
My file structure
What am I doing wrong?
The another way of doing it is adding the scripts to the package.json file.
// package.json
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.ts": [
"eslint 'src/**' --fix",
"npm run test:staged"
],
}