Update docs to encourage user import plugin themself (#18411)

This commit is contained in:
fisker Cheung authored and GitHub committed 2025-12-06 14:43:36 +08:00
1 parent 374138ac6b
commit d8bf3989bd
17 files changed
+222 -189

No files matched your search

+7 -7
View File
@@ -33,7 +33,7 @@ Install it along with [simple-git-hooks](https://github.com/toplenboren/simple-g
```bash
npm install --save-dev simple-git-hooks pretty-quick
echo '{\n "pre-commit": "npx pretty-quick --staged"\n}\n' > .simple-git-hooks.json
node --eval "fs.writeFileSync('.simple-git-hooks.json',JSON.stringify({'pre-commit':'npx pretty-quick --staged'},undefined,2)+'\n')"
npx simple-git-hooks
```
@@ -42,7 +42,7 @@ npx simple-git-hooks
```bash
yarn add --dev simple-git-hooks pretty-quick
echo '{\n "pre-commit": "yarn pretty-quick --staged"\n}\n' > .simple-git-hooks.json
node --eval "fs.writeFileSync('.simple-git-hooks.json',JSON.stringify({'pre-commit':'yarn pretty-quick --staged'},undefined,2)+'\n')"
yarn simple-git-hooks
```
@@ -51,7 +51,7 @@ yarn simple-git-hooks
```bash
pnpm add --save-dev simple-git-hooks pretty-quick
echo '{\n "pre-commit": "pnpm pretty-quick --staged"\n}\n' > .simple-git-hooks.json
node --eval "fs.writeFileSync('.simple-git-hooks.json',JSON.stringify({'pre-commit':'pnpm pretty-quick --staged'},undefined,2)+'\n')"
pnpm simple-git-hooks
```
@@ -60,7 +60,7 @@ pnpm simple-git-hooks
```bash
bun add --dev simple-git-hooks pretty-quick
echo '{\n "pre-commit": "bun pretty-quick --staged"\n}\n' > .simple-git-hooks.json
node --eval "fs.writeFileSync('.simple-git-hooks.json',JSON.stringify({'pre-commit':'bun pretty-quick --staged'},undefined,2)+'\n')"
bun simple-git-hooks
```
@@ -82,7 +82,7 @@ dotnet husky add pre-commit
after installation you can add prettier task to the `task-runner.json`.
```json
```json title="task-runner.json"
{
"command": "npx",
"args": ["prettier", "--ignore-unknown", "--write", "${staged}"],
@@ -150,7 +150,7 @@ To read about how git-format-staged works see [Automatic Code Formatting for Par
Alternately you can save this script as `.git/hooks/pre-commit` and give it execute permission:
```sh
```sh title=".git/hooks/pre-commit"
#!/bin/sh
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
[ -z "$FILES" ] && exit 0
@@ -168,7 +168,7 @@ If git is reporting that your prettified files are still modified after committi
Add something like the following to `.git/hooks/post-commit`:
```sh
```sh title=".git/hooks/post-commit"
#!/bin/sh
git update-index -g
```