[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better linting experience with Trunk Check #1251

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

gewenyu99
Copy link

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.

Copy link
changeset-bot bot commented Jul 9, 2024

⚠️ No Changeset found

Latest commit: 0780202

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant