Skip to content

Conversation

@teemingc
Copy link
Member

@teemingc teemingc commented Jan 8, 2026

This PR changes the kit prettierignore and repo prettier config to correctly include the files in packages/kit/src/exports/vite/build. It was being ignored because we tried to configure prettier to ignore build folders produced by svelte kit test app builds.

This whole time I thought it was an issue with prettier or my local setup. Only found out about this when I read the prettier extension output logs in detail


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

⚠️ No Changeset found

Latest commit: 623d445

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

"packages/*/test/**/build"
],
"options": {
"rangeEnd": 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the heck is up with this? Why aren't these files just ignored if we're formatting 0% of them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like maybe it's some kind of a performance hack? (#13058) Perhaps @dominikg knows more

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rangeEnd 0 makes prettier read the first 0 bytes, so not read the file at all.

this is a way to define ignores in prettier config rather than a separate .prettierignore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way we could do this with a negative pattern? i.e. ignore **/build/** and do !packages/kit/src/exports/vite/build/build_server.js?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing just !packages/kit/src/exports/vite/build/build_server.js seems risky because as soon as you add a second file in the directory you'd be surprised it wasn't getting formatted. I'd want to at least do !packages/kit/src/exports/vite/build

@Rich-Harris Rich-Harris merged commit 50bf727 into main Jan 9, 2026
25 checks passed
@Rich-Harris Rich-Harris deleted the fix-prettier-ignore branch January 9, 2026 00:44
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.

6 participants