Configure lint-staged to run pre-commit scripts only on staged files

This commit is contained in:
2019-08-04 00:08:39 +05:30
parent 8594a9694c
commit c9fc3b9c93
2 changed files with 598 additions and 2 deletions
+8 -2
View File
@@ -40,7 +40,7 @@
},
"husky": {
"hooks": {
"pre-commit": "run-s check:* lint",
"pre-commit": "lint-staged",
"post-commit": "npm run fix:format",
"pre-push": "run-s check:* lint test:src"
}
@@ -97,6 +97,7 @@
"husky": "^3.0.2",
"jest": "24.8.0",
"jest-prettyhtml-matchers": "1.0.22",
"lint-staged": "^9.2.1",
"npm-run-all": "4.1.5",
"prettier": "1.18.2",
"react": "16.8.6",
@@ -116,5 +117,10 @@
"shelljs-plugin-authors": "2.0.10",
"ts-jest": "24.0.2",
"typescript": "3.5.3"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"run-s check:* lint"
]
}
}
}