Git Hooks
TIP
This document was generated by machine translation. If there are any errors, please inform us
Write in the front
Most code written in JS is used to using the runtime to determine if there is a problem with the code or not.
For example, using JS development to interface with the back-end is such a process, when the interface is good, tune the interface, get the data, and then figure out how to stuff the data into the page inside the
If it's a very simple page, this process seems to be fine. But for a slightly more complex one, the code written through this process would be the foundation of a mountain of shit, making it extremely headache-inducing to troubleshoot various issues in the later stage.
TypeScript is a great tool to write high-quality code, the process of defining data types is the process of defining the front-end data model, once the data model has been determined, the data model of the various operations can be achieved using pure functions, and then the data combined with the responsive, you only need to introduce the corresponding pure functions to do a simple secondary packaging can be, most people do not adapt to the TS Most people are not comfortable with the type of TS, mainly because they haven't switched to the development mode. You can try to use this mode for a few sections to experience the charm of TypeScript, and then decide whether or not to remove the git-hooks
.
Using git-hooks
for pre-commit checksums not only helps you improve your own code, but also reduces the cost of maintaining your project, and helps you take over other people's code. The few downsides to all of this are the small amount of time it takes to learn (Soybean-admin's project has 100% type coverage, which is best practice and the best time to get started with TypeScript) and get used to it, so you can try it out for a while (feel free to discuss this with the community) before deciding to remove it. You can try it out for a while (feel free to discuss it with us in the community) before deciding whether to remove git-hooks
.
Remove git-hooks
Option 1: Temporary closure of checksums
It is recommended to follow the well-established type checks as fully as possible initially, only skipping them slightly a few times by temporarily cancelling the submission checks when needed.
git add .
git commit -m "commit message"
git commit -m "commit message" --no-verify
git push
Option 2: Permanently disable checksums
not recommended
1、Remove the commands from simple-git-hooks
in `package.json
2、Execute the simple-git-hooks
command.