Skip to content

Commit

Permalink
Add guide on how to set trunk.io as default formatter in vscode (#379)
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent (Wen Yu) Ge <[email protected]>
  • Loading branch information
amkisko and gewenyu99 authored Dec 4, 2024
1 parent 5a1af76 commit de6d60b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions code-quality/ide-integration/vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ trunk config share

or click on the notification to "Share trunk config", which will commit `.trunk/trunk.yaml`, the Trunk configuration file.

### Trunk as default formatter

You can use Trunk as your default formatter in VSCode if you have Trunk configured for the project.

You can set `trunk.io` as the default formatter for just one language as in the example, or as a default for all languages.

In your `settings.json` like this:
```json
"[markdown]": {
"editor.defaultFormatter": "trunk.io"
}
```

For manual formatting, from command pallete use `Format Document With...` and select `Trunk` there.

### Learn more

Check out how to [install the CLI](../setup-and-installation/), [set it up in CI](../setup-and-installation/initialize-trunk.md), [ignore issues](../linters/ignoring-issues-and-files.md), and set up [Custom Linters](../linters/custom-linters.md).
Expand Down

0 comments on commit de6d60b

Please sign in to comment.