Better linting experience with Trunk Check #1251
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @TGlide,
Following up on our call, I've updated the Trunk configs. Here's a PR for linting with Trunk.
Thank you for trying Trunk :)
What this PR does
Trunk is a meta-linter. It installs and manages a variety of linters, lets you define common linter configs on repo or remotely for many repos, installs them hermetically, and runs them only on new code changes.
As code standards change and as repos adopt new linters, you need a way to run them only on new changes to not create a ton of noise, but still run them nightly to continuously improve code quality.
Running only on files changed also makes it faster to run.
Linters introduced
Trunk Check will use existing ESLint and prettier configs. I've pinned them to match versions in your
package.json
. I do recommend upgrading ESLint and Prettier and slowly accepting their breaking suggestions on files you change.I've also introduced some linters like Trivy, osv-scanner, and trufflehog to find vulnerabilities + prevent accidentally leaked secrets.
Since there are images, we have oxipng + svgo to help optimize them.
Lmk if you need to talk about config and feel free to disable ones you don't need.
Workflow changes
You still run linters with
pnpm lint
, nothing changes. The GitHub Actions will still run this command. Trunk Check has a web app and reporting capabilities for nightly CI runs. You can adopt this if you needed, lmk if you're interested.Config
All new configs are in
.trunk
. If you want to share configs across many repos, we can help set that up.