-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
chore: fix prettier ignoring source code in with build in the name #15133
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
Conversation
|
| "packages/*/test/**/build" | ||
| ], | ||
| "options": { | ||
| "rangeEnd": 0 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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 ignorebuildfolders 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:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits