From: Evan You Date: Fri, 3 Feb 2023 10:03:33 +0000 (+0800) Subject: docs: document git hooks [ci skip] X-Git-Tag: v3.3.0-alpha.1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78a52ef3fedd9495bebcc9614f5755381d669d63;p=thirdparty%2Fvuejs%2Fcore.git docs: document git hooks [ci skip] --- diff --git a/.github/contributing.md b/.github/contributing.md index e62f1263a0..5ffdea4acd 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -76,6 +76,14 @@ A high level overview of tools used: - [Prettier](https://prettier.io/) for code formatting - [ESLint](https://eslint.org/) for static error prevention (outside of types) +## Git Hooks + +The project uses [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks) to enforce the following on each commit: + +- Type check the entire project +- Automatically format changed files using Prettier +- Verify commit message format (logic in `scripts/verifyCommit.mjs`) + ## Scripts **The examples below will be using the `nr` command from the [ni](https://github.com/antfu/ni) package.** You can also use plain `npm run`, but you will need to pass all additional arguments after the command after an extra `--`. For example, `nr build runtime --all` is equivalent to `npm run build -- runtime --all`. @@ -106,7 +114,7 @@ nr build runtime-core nr build runtime --all ``` -Note that `nr build` uses `rollup-plugin-esbuild` for transpiling typescript and **does not perform type checking**. To run type check on the entire codebase, run `nr check`. +Note that `nr build` uses `rollup-plugin-esbuild` for transpiling typescript and **does not perform type checking**. To run type check on the entire codebase, run `nr check`. Type checks are also automatically run on each commit. #### Build Formats