diff --git a/docs/precommit.md b/docs/precommit.md index 0eea0a72464d..7820a503d691 100644 --- a/docs/precommit.md +++ b/docs/precommit.md @@ -57,33 +57,33 @@ Git-format-staged requires Python v3 or v2.7. Python is usually pre-installed on ```bash -npx husky-init +npx husky init npm install --save-dev git-format-staged -npx husky set .husky/pre-commit "git-format-staged -f 'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"' ." +node --eval "fs.writeFileSync('.husky/pre-commit', 'git-format-staged -f \'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"\' .\n')" ``` ```bash -npx husky-init # add --yarn2 for Yarn 2 +yarn husky init yarn add --dev git-format-staged -yarn husky set .husky/pre-commit "git-format-staged -f 'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"' ." +node --eval "fs.writeFileSync('.husky/pre-commit', 'git-format-staged -f \'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"\' .\n')" ``` ```bash -pnpm exec husky-init +pnpm exec husky init pnpm add --save-dev git-format-staged -pnpm husky set .husky/pre-commit "git-format-staged -f 'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"' ." +node --eval "fs.writeFileSync('.husky/pre-commit', 'git-format-staged -f \'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"\' .\n')" ``` ```bash -bunx husky-init +bunx husky init bun add --dev git-format-staged -echo "git-format-staged -f 'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"' ." > .husky/pre-commit +bun --eval "fs.writeFileSync('.husky/pre-commit', 'git-format-staged -f \'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"\' .\n')" ``` diff --git a/website/versioned_docs/version-stable/precommit.md b/website/versioned_docs/version-stable/precommit.md index 44209d0a4729..63f78a0e45a9 100644 --- a/website/versioned_docs/version-stable/precommit.md +++ b/website/versioned_docs/version-stable/precommit.md @@ -73,17 +73,17 @@ Git-format-staged requires Python v3 or v2.7. Python is usually pre-installed on ```bash -npx husky-init +npx husky init npm install --save-dev git-format-staged -npx husky set .husky/pre-commit "git-format-staged -f 'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"' ." +node --eval "fs.writeFileSync('.husky/pre-commit', 'git-format-staged -f \'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"\' .\n')" ``` ```bash -npx husky-init # add --yarn2 for Yarn 2 +yarn husky init yarn add --dev git-format-staged -yarn husky set .husky/pre-commit "git-format-staged -f 'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"' ." +node --eval "fs.writeFileSync('.husky/pre-commit', 'git-format-staged -f \'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"\' .\n')" ``` @@ -91,7 +91,7 @@ yarn husky set .husky/pre-commit "git-format-staged -f 'prettier --ignore-unknow ```bash pnpm exec husky-init pnpm add --save-dev git-format-staged -pnpm husky set .husky/pre-commit "git-format-staged -f 'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"' ." +node --eval "fs.writeFileSync('.husky/pre-commit', 'git-format-staged -f \'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"\' .\n')" ``` @@ -99,7 +99,7 @@ pnpm husky set .husky/pre-commit "git-format-staged -f 'prettier --ignore-unknow ```bash bunx husky init bun add --dev git-format-staged -echo "git-format-staged -f 'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"' ." > .husky/pre-commit +bun --eval "fs.writeFileSync('.husky/pre-commit', 'git-format-staged -f \'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"\' .\n')" ```