The repository is set up with husky
and lint-staged
to run Git hooks whenever you commit and/or push your changes. This is to catch errors early and keep code quality healthy.
The Git hooks configured by default are the following:
pre-commit
: runslint-staged
to run scripts on your staged fileseslint
is ran on all source files by defaultprettier
is ran on all source files and CSS, JSON, MD files by default- To configure what scripts run on staged files, see
package.json -> "lint-staged"
pre-push
: runsnpm run validate
to make sure codebase is healthynpm run validate
runs all NPM scripts that start withvalidate:
parallely- by default, this includes
- linting
- type-checking
- checking for build errors
- running all tests
- checking for proper code style / formatting
If your commit or push hooks fail, you need to fix your code and re-try.
If you're not sure what the problem is on pre-push
, see which script failed during npm run validate
and run that script individually for easier debugging.