Skip to content

fix(prettier): skip non-JSON prettierrc config #527

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

Merged
merged 4 commits into from
Apr 10, 2025

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Apr 7, 2025

If the project already has a .prettierrc which is YAML, we will currently throw an uncaught exception trying to parse it as JSON.

This change means we will skip such files and only try to mutate JSON configs.

If the project already has a `.prettierrc` which is YAML, we will
currently throw an uncaught exception trying to parse it as JSON.

This change means we will skip such files and only try to mutate JSON
configs.
Copy link

changeset-bot bot commented Apr 7, 2025

🦋 Changeset detected

Latest commit: 55f45b3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

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

@43081j
Copy link
Contributor Author

43081j commented Apr 7, 2025

cc @benmccann @manuel3108

if you can word the warning message any better, let me know or feel free to push to this branch

basically, if you have an existing .prettierrc which is not JSON, we will warn and skip updating it.

Copy link

pkg-pr-new bot commented Apr 10, 2025

Open in StackBlitz

npx https://pkg.pr.new/sveltejs/cli/svelte-migrate@527
npx https://pkg.pr.new/sveltejs/cli/sv@527

commit: 55f45b3

Copy link
Member

@AdrianGonz97 AdrianGonz97 left a comment

Choose a reason for hiding this comment

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

thank you!

@AdrianGonz97 AdrianGonz97 merged commit c94db33 into sveltejs:main Apr 10, 2025
7 checks passed
@github-actions github-actions bot mentioned this pull request Apr 10, 2025
@43081j 43081j deleted the prettierornot branch April 10, 2025 18:18
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.

3 participants