-
Book Overview & Buying
-
Table Of Contents
React Application Architecture for Production..
By :
Having static code analysis tools such as TypeScript, ESLint, and Prettier is great; we have configured them and can run individual scripts whenever we make some changes to ensure everything is in the best order.
However, there are some drawbacks. Developers can forget to run all checks before committing to the repo, which can still bring problematic and inconsistent code to production.
Fortunately, there is a solution that can fix this problem: whenever we try to commit to the repository, we want to run all checks in an automated way. This is where pre-commit hooks come in.
Pre-commit hooks are scripts that run automatically before we can commit our code to the repository. They act as a safety net, ensuring that only high-quality code makes it into our code base.
Without pre-commit hooks, we might accidentally commit the following: