diff --git a/docs/precommit.md b/docs/precommit.md index bbe9f4573..7925c9d7f 100644 --- a/docs/precommit.md +++ b/docs/precommit.md @@ -19,42 +19,7 @@ This will install [husky](https://github.com/typicode/husky) and [lint-staged](h Read more at the [lint-staged](https://github.com/okonet/lint-staged#configuration) repo. -## Option 2. [pretty-quick](https://github.com/azz/pretty-quick) - -**Use Case:** Great for when you want an entire file formatting on your changed/staged files. - -Install it along with [husky](https://github.com/typicode/husky): - - - - -```bash -npx husky-init -npm install --save-dev pretty-quick -npx husky set .husky/pre-commit "npx pretty-quick --staged" -``` - - - -```bash -npx husky-init # add --yarn2 for Yarn 2 -yarn add --dev pretty-quick -yarn husky set .husky/pre-commit "npx pretty-quick --staged" -``` - - - -```bash -pnpm exec husky-init -pnpm add --save-dev pretty-quick -pnpm exec husky set .husky/pre-commit "npx pretty-quick --staged" -``` - - - -Read more at the [pretty-quick](https://github.com/azz/pretty-quick) repo. - -## Option 3. [pre-commit](https://github.com/pre-commit/pre-commit) +## Option 2. [pre-commit](https://github.com/pre-commit/pre-commit) **Use Case:** Great when working with multi-language projects. @@ -69,7 +34,7 @@ Copy the following config into your `.pre-commit-config.yaml` file: Read more at [mirror of prettier package for pre-commit](https://github.com/pre-commit/mirrors-prettier) and the [pre-commit](https://pre-commit.com) website. -## Option 4. [Husky.Net](https://github.com/alirezanet/Husky.Net) +## Option 3. [Husky.Net](https://github.com/alirezanet/Husky.Net) **Use Case:** A dotnet solution to use Prettier along with other code quality tools (e.g. dotnet-format, ESLint, Stylelint, etc.). It supports multiple file states (staged - last-commit, git-files etc.) @@ -90,7 +55,7 @@ after installation you can add prettier task to the `task-runner.json`. } ``` -## Option 5. [git-format-staged](https://github.com/hallettj/git-format-staged) +## Option 4. [git-format-staged](https://github.com/hallettj/git-format-staged) **Use Case:** Great for when you want to format partially-staged files, and other options do not provide a good fit for your project. @@ -134,7 +99,7 @@ Add or remove file extensions to suit your project. Note that regardless of whic To read about how git-format-staged works see [Automatic Code Formatting for Partially-Staged Files](https://www.olioapps.com/blog/automatic-code-formatting/). -## Option 6. Shell script +## Option 5. Shell script Alternately you can save this script as `.git/hooks/pre-commit` and give it execute permission: diff --git a/website/versioned_docs/version-stable/precommit.md b/website/versioned_docs/version-stable/precommit.md index a7507c552..8baa51c8c 100644 --- a/website/versioned_docs/version-stable/precommit.md +++ b/website/versioned_docs/version-stable/precommit.md @@ -20,42 +20,7 @@ This will install [husky](https://github.com/typicode/husky) and [lint-staged](h Read more at the [lint-staged](https://github.com/okonet/lint-staged#configuration) repo. -## Option 2. [pretty-quick](https://github.com/azz/pretty-quick) - -**Use Case:** Great for when you want an entire file formatting on your changed/staged files. - -Install it along with [husky](https://github.com/typicode/husky): - - - - -```bash -npx husky-init -npm install --save-dev pretty-quick -npx husky set .husky/pre-commit "npx pretty-quick --staged" -``` - - - -```bash -npx husky-init # add --yarn2 for Yarn 2 -yarn add --dev pretty-quick -yarn husky set .husky/pre-commit "npx pretty-quick --staged" -``` - - - -```bash -pnpm exec husky-init -pnpm add --save-dev pretty-quick -pnpm exec husky set .husky/pre-commit "npx pretty-quick --staged" -``` - - - -Read more at the [pretty-quick](https://github.com/azz/pretty-quick) repo. - -## Option 3. [pre-commit](https://github.com/pre-commit/pre-commit) +## Option 2. [pre-commit](https://github.com/pre-commit/pre-commit) **Use Case:** Great when working with multi-language projects. @@ -70,7 +35,7 @@ Copy the following config into your `.pre-commit-config.yaml` file: Read more at [mirror of prettier package for pre-commit](https://github.com/pre-commit/mirrors-prettier) and the [pre-commit](https://pre-commit.com) website. -## Option 4. [Husky.Net](https://github.com/alirezanet/Husky.Net) +## Option 3. [Husky.Net](https://github.com/alirezanet/Husky.Net) **Use Case:** A dotnet solution to use Prettier along with other code quality tools (e.g. dotnet-format, ESLint, Stylelint, etc.). It supports multiple file states (staged - last-commit, git-files etc.) @@ -91,7 +56,7 @@ after installation you can add prettier task to the `task-runner.json`. } ``` -## Option 5. [git-format-staged](https://github.com/hallettj/git-format-staged) +## Option 4. [git-format-staged](https://github.com/hallettj/git-format-staged) **Use Case:** Great for when you want to format partially-staged files, and other options do not provide a good fit for your project. @@ -135,7 +100,7 @@ Add or remove file extensions to suit your project. Note that regardless of whic To read about how git-format-staged works see [Automatic Code Formatting for Partially-Staged Files](https://www.olioapps.com/blog/automatic-code-formatting/). -## Option 6. Shell script +## Option 5. Shell script Alternately you can save this script as `.git/hooks/pre-commit` and give it execute permission: