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

How to fallback to default prettier formating in non svelte files #465

Open
SteveALee opened this issue Sep 26, 2024 · 3 comments
Open

How to fallback to default prettier formating in non svelte files #465

SteveALee opened this issue Sep 26, 2024 · 3 comments

Comments

@SteveALee
Copy link

SteveALee commented Sep 26, 2024

In my svelte git hub project (edited with vs code) I also have a plain HTML + JS + CSS group of files (in static) but prettier will not work on them unless I disable the svlete plugin.

svelte plugin is enabled in my .prettier.rc with

{
  "plugins": ["prettier-plugin-svelte"],
  "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
....
}

I have to invalidate the first line when editing my vanilla files and then restore it when editing the svelte files.

I can find no options in the plugin or prettier docs for how to restrict plugin processing to certain folders, I'm also surprised the plugin is not restricted to .svelte files

@dummdidumm
Copy link
Member

This should work as you expected. Please provide a reproduction so we can properly look into this

@SteveALee
Copy link
Author

Thanks for confirmining. I'll work on a minimal repro next week.

@SteveALee
Copy link
Author

Here's a minimal setup - see REAME - https://github.com/SteveALee/prettier-plugin-svelte-bug/tree/master

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

No branches or pull requests

2 participants