Skip to content

Commit

Permalink
fix: fixes Husky's tsc pre-commit hook
Browse files Browse the repository at this point in the history
Running `tsc` in a pre-commit hook has a known issue (see:
microsoft/TypeScript#27379). Until this is fixed upstream pull the tsc
check out as an npm script and explicitly run it
  • Loading branch information
baylisscg committed Nov 11, 2023
1 parent a25e5a8 commit f900a04
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"start-sw": "dotenv node build/src/index.js",
"start": "npm run build && npm run start-sw",
"test": "jest --watch",
"checkTs": "tsc --noEmit",
"lint": "eslint src/**/*.ts",
"prepare": "husky install"
},
Expand Down Expand Up @@ -91,8 +92,12 @@
"lint-staged": {
"*.js": "eslint --cache --fix",
"**/*.ts?(x)": [
"tsc -p tsconfig.json --noEmit",
"eslint --cache --fix"
]
},
"husky": {
"hooks": {
"pre-commit": "npm run checkTs && lint-staged"
}
}
}

0 comments on commit f900a04

Please sign in to comment.