Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions runtime/reference/cli/check.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ openGraphTitle: "deno check"
description: "Download and type-check code without execution"
---

## Example
## Examples

Type-check without execution.
Type-check a TypeScript file without execution:

```ts title="example.ts"
const x: string = 1 + 1n;
Expand All @@ -18,3 +18,13 @@ const x: string = 1 + 1n;
```bash
deno check example.ts
```

## Type-checking JavaScript files

If you have a JavaScript-only project and want to type-check it with Deno, you
can use the `--check-js` flag instead of adding `// @ts-check` to every file or
setting `compilerOptions.checkJs` in your `deno.json`:

```bash
deno check --check-js main.js
```
10 changes: 10 additions & 0 deletions runtime/reference/cli/fmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ enclosed in triple backticks and have a language attribute.

:::

## Checking formatting in CI

Use `--check` to verify files are formatted without modifying them. Add
`--fail-fast` to stop on the first unformatted file instead of reporting all of
them, which is useful in large codebases:

```sh
deno fmt --check --fail-fast
```

## Ignoring Code

### JavaScript / TypeScript / JSONC
Expand Down