Skip to content

Commit 423420b

Browse files
committed
feat(lint-staged): add lint-staged
1 parent 6c6926e commit 423420b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"build": "ncc build ./src/index.ts -m -o ./dist/",
1212
"pretest": "rimraf ./coverage",
1313
"test": "jest",
14-
"watch": "tsc -w --project ./"
14+
"watch": "tsc -w --project ./",
15+
"prepare": "tsc --noEmit --project ./ && eslint ./src/**/*.ts --quiet && npm test"
1516
},
1617
"repository": {
1718
"type": "git",
@@ -23,9 +24,15 @@
2324
],
2425
"husky": {
2526
"hooks": {
26-
"pre-commit": "tsc --noEmit --project ./ && eslint ./src/**/*.ts --quiet && npm run test"
27+
"pre-commit": "lint-staged && npm run prepare",
28+
"pre-push": "npm run test"
2729
}
2830
},
31+
"lint-staged": {
32+
"*.ts": [
33+
"eslint --ext .ts ./src"
34+
]
35+
},
2936
"jest": {
3037
"collectCoverage": true,
3138
"coveragePathIgnorePatterns": [
@@ -79,6 +86,7 @@
7986
"generate-changelog": "1.8.0",
8087
"husky": "4.2.5",
8188
"jest": "26.1.0",
89+
"lint-staged": "^10.2.11",
8290
"mime": "2.4.6",
8391
"prettier": "2.0.5",
8492
"rimraf": "3.0.2",

0 commit comments

Comments
 (0)