Skip to content

Commit 664e764

Browse files
bartlomiejuclaude
andcommitted
docs: add deno check --check-js and deno fmt --fail-fast
- Document --check-js flag for type-checking JavaScript files without config - Document --fail-fast flag for stopping on first unformatted file in CI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3bc9f66 commit 664e764

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

runtime/reference/cli/check.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ openGraphTitle: "deno check"
77
description: "Download and type-check code without execution"
88
---
99

10-
## Example
10+
## Examples
1111

12-
Type-check without execution.
12+
Type-check a TypeScript file without execution:
1313

1414
```ts title="example.ts"
1515
const x: string = 1 + 1n;
@@ -18,3 +18,13 @@ const x: string = 1 + 1n;
1818
```bash
1919
deno check example.ts
2020
```
21+
22+
## Type-checking JavaScript files
23+
24+
If you have a JavaScript-only project and want to type-check it with Deno, you
25+
can use the `--check-js` flag instead of adding `// @ts-check` to every file or
26+
setting `compilerOptions.checkJs` in your `deno.json`:
27+
28+
```bash
29+
deno check --check-js main.js
30+
```

runtime/reference/cli/fmt.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ enclosed in triple backticks and have a language attribute.
5757

5858
:::
5959

60+
## Checking formatting in CI
61+
62+
Use `--check` to verify files are formatted without modifying them. Add
63+
`--fail-fast` to stop on the first unformatted file instead of reporting all of
64+
them, which is useful in large codebases:
65+
66+
```sh
67+
deno fmt --check --fail-fast
68+
```
69+
6070
## Ignoring Code
6171

6272
### JavaScript / TypeScript / JSONC

0 commit comments

Comments
 (0)