-
Notifications
You must be signed in to change notification settings - Fork 130
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
Unable to get working VSCode formatOnSave #28
Comments
Ahh, partially found the issue in #10 as I am using pnpm... I'm guessing it's because I am calling |
@markjwiggins Hey, have you seen this compatibility message in the readme? Try removing the
|
Hi @reinink My
|
Hey, i had some similar issues with my .blade.php files After a little bit of research i put the following in my prettier config
Maybe it helps you, of course you would have to change ".blade.php" to ".svelte" |
Hey @markjwiggins. In your settings you have the default formatter for {
"[svelte]": {
"editor.formatOnSave": true,
- "editor.defaultFormatter": "svelte.svelte-vscode"
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
}
} This is because |
Hi @bradlc |
Ah sorry @markjwiggins, I missed that! Does restarting the extension host help? ( |
Unfortunately not, tried running the command, also restarting VSCode and running it... |
@dylanmichaelryan sorry I missed your comment the other day, adding an override doesn't seem to help. |
I had the same issue using btw I just found this that solves the issue with |
@MatiasVerdier great find! plugins: [require("prettier-plugin-tailwindcss")],
overrides: [
{
files: "*.svelte",
options: { parser: "svelte" }
}
], in my May be worth adding a note in the documentation unless I'm in a minority of Svelte + pnpm + tailwindcss 😃 |
Glad you resolved the issue @markjwiggins! Will consider adding the |
Apologies if this is a naive question, not had much experience with how prettier & plugins work...
I am trying to get this to work in a Svelte (+TS) setup, and it seems to run fine if I run the
pnpm run format
script across all files, but the plugin is not running on save withformatOnSave
enabled in VSCode.Is there something I need to set to enable plugins when running within VSCode
formatOnSave
?Or is it because the
formatOnSave
uses the Prettier extension, so doesn't see the project installed plugin and would only work if a Tailwind Prettier extension appeared?VSCode settings.json
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
Current set up...
.prettierrc
tailwind.config.cjs
in the root of application (same as.prettierrc
).vscode/settings.json
Any guidance would be great!
The text was updated successfully, but these errors were encountered: