All frontends projects use Husky and Lint Staged to prevent bad commits.
Install the following libraries to your project:
yarn add husky lint-staged -D
Then add the following code:
package.json
"husky": {
"hooks": {
"pre-commit": "tsc --noEmit && lint-staged"
}
},
"lint-staged": {
"*.{js,ts,tsx}": [
"your command here",
"your second command here",
],
"*.{css,scss}": [
"your command here",
]
},