summaryrefslogtreecommitdiff
path: root/std/manual.md
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2020-05-04 15:17:15 -0400
committerGitHub <noreply@github.com>2020-05-04 15:17:15 -0400
commit60f2d57fb7a01a438e99c5d2ea655cfa44641755 (patch)
tree0e70945a9525ebcf128883b1fbcb7832f3349186 /std/manual.md
parent8c509bd88517ebc92673d9da91e71a08868e830e (diff)
feat(fmt): Add `deno-fmt-ignore` and `deno-fmt-ignore-file` comment support (#5075)
Diffstat (limited to 'std/manual.md')
-rw-r--r--std/manual.md34
1 files changed, 34 insertions, 0 deletions
diff --git a/std/manual.md b/std/manual.md
index 29abe2c66..8df8adfd3 100644
--- a/std/manual.md
+++ b/std/manual.md
@@ -1298,6 +1298,40 @@ All listeners added using `window.addEventListener` were run, but
`window.onload` and `window.onunload` defined in `main.ts` overridden handlers
defined in `imported.ts`.
+## `deno fmt`
+
+Deno ships with a built in code formatter that auto-formats TypeScript and
+JavaScript code.
+
+```shell
+# format all JS/TS files in the current directory and subdirectories
+deno fmt
+# format specific files
+deno fmt myfile1.ts myfile2.ts
+# check if all the JS/TS files in the current directory and subdirectories are formatted
+deno fmt --check
+# format stdin and write to stdout
+cat file.ts | deno fmt -
+```
+
+Ignore formatting code by preceding it with a `// deno-fmt-ignore` comment:
+
+<!-- prettier-ignore-start -->
+
+```ts
+// deno-fmt-ignore
+export const identity = [
+ 1, 0, 0,
+ 0, 1, 0,
+ 0, 0, 1,
+];
+```
+
+<!-- prettier-ignore-end -->
+
+Or ignore an entire file by adding a `// deno-fmt-ignore-file` comment at the
+top of the file.
+
## Internal details
### Deno and Linux analogy