VS Code
Trunk is also available as a VSCode extension that you can use to streamline your linting and formatting experiences.
By default, Trunk will try to automatically initialize itself in single-player mode. This means that it'll create a Trunk configuration that is hidden from git, which allows you to try it out without Trunk's versioning powers.
If Trunk has not initialized itself in single-player mode, then you will need to initialize it manually, either by pressing the 'Initialize Trunk' button in the Trunk side panel:

initialize trunk
or via the command line: just install the CLI and run
trunk init
in your repo.- Install Trunk →
curl https://get.trunk.io -fsSL | bash
- Setup Trunk in your repo →
trunk init
- See and fix issues as you code in VSCode → You're in the right place 👍
Trunk will suggest tools that will supercharge your development, from
actionlint
, for your GitHub Actions, tosql-formatter
and sqlfluff
for your SQL, toyamllint
, for your YAML files.We believe that everything in your repository not only can be, but also should be, automatically formatted and automatically linted. We also recognize that a big part of this is making it easy for our users to discover tools that are newly applicable to them, so when Trunk is initialized, we turn on as much as we can, and then periodically follow up with suggestions for new tools.
On the side bar to the left you'll see the Trunk icon, which you can use to open the side panel to view issues. By default, issues are populated for every file you open as well as any modified files.

side panel
Trunk also shows Trunk Check Issues in a panel in the File Explorer, but you can hide it if you wish:

hide explorer panel
In single-player mode, Trunk creates a configuration file and hides it from Git, so that you can test out Trunk on your own and get familiar with how it works, without committing this file.
Users normally check this file in to your repository so that you can run Trunk reproducibly: it pins the version of trunk, as well as that of every runtime and linter that you've enabled, allowing your team to guarantee that everyone and your CI runners are always running the exact same checks on your code.
To check it in to your repository, all you have to do is run
trunk config share
which will commit
.trunk/trunk.yaml
, the Trunk configuration file.
linter code docs

trunk-ignore
trunk.inlineDecorators
– allows to disable inline decorators for diagnostics.trunk.inlineDecoratorsForAllExtensions
– allows to render inline decorators only for diagnostics that was generated by Trunk.
If you look at the "Window" output for the extension, you may find useful error logs.
Last modified 1mo ago