Use git commit hooks to run the following steps on every code commit -

  1. Prettier to auto-format the code (Coding Styling and Linting)
  2. Stage the files that Prettier formats
  3. Run ESlint (Coding Styling and Linting)
  4. Build the app
  5. Run unit tests → Detect all the projects that are affected in the monorepo due to the file changes and run unit tests on them to check if all tests pass. Do not run E2E tests (as they will run as part of PR merge checks).

Only if all 5 steps pass is when we allow the commit to proceed.