ok Setup with Husky
This is the pre-commit hook set up a strategy I followed in our angular projects. By setting this hook we can ensure that committed codes will be linting error-free and formatted with prettier code-formatter.
We install the following devDependencies
yarn add husky lint-staged prettier -D
husky makes it easy to use githooks as if they are npm scripts.lint-staged allows us to run scripts on staged files in git.prettier is the JavaScript formatter we will run before commits.
Once those are installed, we add the below configuration to package.json file:
 "devDependencies": {
  // ...
 },
 "lint-staged": {
   "src/**/*.{js,ts,scss,md,html,json}": [
     "prettier --write",
     "git add"
   ]
 },
 "husky": {
   "hooks": {
     "pre-commit": "ng lint && lint-staged",
     "pre-push": "ng build --prod"
   }
 }
Next time when you commit the changes, this script will auto-execute and will
run ng lint first to lint the files. If there are any errors in formatting or
coding style, then it will not proceed to commit the files, otherwise, the
staged files will be formatted automatically and will be committed. 🥳
Let me know what you think