Create a pre-commit hook which will check for any compiling errors. You can check `husky` or simply run `npm run lint` and `tsc` both.