Add Deno commands to docs (#19419)

This commit is contained in:
Bartek Iwańczuk authored and GitHub committed 2026-06-23 16:59:08 +08:00
1 parent bf3ca0c886
commit aadd3ee2b8
4 files changed
+55 -1

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ prettier [options] [file/dir/glob ...]
:::note
To run your locally installed version of Prettier, prefix the command with `npx`, `yarn exec`, `pnpm exec`, or `bunx`, i.e. `npx prettier --help`, `yarn exec prettier --help`, `pnpm exec prettier --help`, or `bunx prettier --help`.
To run your locally installed version of Prettier, prefix the command with `npx`, `yarn exec`, `pnpm exec`, `bunx`, or `deno x`, i.e. `npx prettier --help`, `yarn exec prettier --help`, `pnpm exec prettier --help`, `bunx prettier --help`, or `deno x prettier --help`.
:::
+29
View File
@@ -36,6 +36,13 @@ pnpm add --save-dev --save-exact prettier@%PRETTIER_VERSION%
bun add --dev --exact prettier@%PRETTIER_VERSION%
```
</TabItem>
<TabItem value="deno">
```bash
deno install --dev --save-exact prettier@%PRETTIER_VERSION%
```
</TabItem>
</Tabs>
@@ -136,6 +143,19 @@ If you forget to install Prettier first, `bunx` will temporarily download the la
:::
</TabItem>
<TabItem value="deno">
```bash
deno x prettier . --write
```
:::info
What is `deno x` doing at the start? It runs the locally installed Prettier. We’ll leave off the `deno x` part for brevity throughout the rest of this file!
:::
</TabItem>
</Tabs>
@@ -219,6 +239,15 @@ bunx husky init
bun --eval "fs.writeFileSync('.husky/pre-commit','bunx lint-staged\n')"
```
</TabItem>
<TabItem value="deno">
```bash
deno install --dev husky lint-staged
deno x husky init
deno eval "Deno.writeTextFileSync('.husky/pre-commit','deno x lint-staged\n')"
```
</TabItem>
</Tabs>
+18
View File
@@ -64,6 +64,15 @@ node --eval "fs.writeFileSync('.simple-git-hooks.json',JSON.stringify({'pre-comm
bun simple-git-hooks
```
</TabItem>
<TabItem value="deno">
```bash
deno install --dev simple-git-hooks pretty-quick
deno eval "Deno.writeTextFileSync('.simple-git-hooks.json',JSON.stringify({'pre-commit':'deno x pretty-quick --staged'},undefined,2)+'\n')"
deno x simple-git-hooks
```
</TabItem>
</Tabs>
@@ -139,6 +148,15 @@ bun add --dev git-format-staged
bun --eval "fs.writeFileSync('.husky/pre-commit', 'git-format-staged -f \'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"\' .\n')"
```
</TabItem>
<TabItem value="deno">
```bash
deno x husky init
deno install --dev git-format-staged
deno eval "Deno.writeTextFileSync('.husky/pre-commit', 'git-format-staged -f \'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"\' .\n')"
```
</TabItem>
</Tabs>
+7
View File
@@ -109,6 +109,13 @@ pnpm add --save-dev @username/prettier-config
bun add --dev @username/prettier-config
```
</TabItem>
<TabItem value="deno">
```bash
deno install --dev @username/prettier-config
```
</TabItem>
</Tabs>