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

Strange issue in vscode when pasting #427

Open
alancwoo opened this issue Feb 8, 2024 · 3 comments
Open

Strange issue in vscode when pasting #427

alancwoo opened this issue Feb 8, 2024 · 3 comments

Comments

@alancwoo
Copy link

alancwoo commented Feb 8, 2024

I'm not sure if this is the correct place to post this, but I'm having an issue with:

VSCode 1.86.1
Prettier Extension v10.1.0
Svelte for VS Code v108.2.2

If I paste anything in a document, the entire script tag is immediately replaced by a base64 encoding of its contents:

Screen.Recording.2024-02-08.at.18.58.08.mov

My .prettierrc is as follows:

{
  "useTabs": false,
  "tabWidth": 2,
  "singleQuote": true,
  "trailingComma": "none",
  "printWidth": 100,
  "plugins": ["prettier-plugin-svelte"],
  "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}

This only happens in .svelte files, and only when "plugins": ["prettier-plugin-svelte"] is set in .prettierrc

@alancwoo
Copy link
Author

alancwoo commented Feb 8, 2024

Sorry I found an old issue here: #240 which is closed, so I can indeed confirm this is still happening.

@alancwoo
Copy link
Author

alancwoo commented Feb 8, 2024

If I set editor.formatOnSave to false, then this no longer happens. I'm actually not sure why I had that enabled, but in any case it should not be happening regardless.

@dummdidumm
Copy link
Member

dummdidumm commented Feb 13, 2024

Maybe you're running into #233
Also, which extension is responsible for formatting the code? The Svelte extension or the Prettier extension (you can see that in your VS Code config)? Also make sure that you have the latest version of prettier and prettier-plugin-svelte in your package.json.
If this still persists, we need a proper reproduction.

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

No branches or pull requests

2 participants