-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Bug] New line added in comment block (and maybe generally when dealing with embedded formats with syntax errors) #42
Comments
seems to be related to prettier/prettier-vscode#691 |
Thanks for the report. I will look into this as soon as I get a chance. |
Are you using prettier-plugin-jsdoc ? I am running into a similar issue here: #49 I suspect that prettier-plugin-jsdoc considers your documentation block invalid due to the lines starting without I managed to recreate the issue with this code:
And if I add the leading |
thank you so much @gitKrystan will try that locally and get back |
Weirdly, if I move your code into a |
I'm also hitting this issue unfortunately. Every save I do adds an extra newline My template looks like this // prettier-ignore
export const MyComponent: TOC<Signature> = <template><span class="inline">
content goes here
// new line keeps getting added here
</span></template> Specifically, I have that prettier-ignore line there, to avoid extra whitespace before/after the template tags, as on this inline component the whitespace control is important. Same occurs if I use When I format on save, it correctly avoids changing the opening If this is unavoidable, is there a different way to avoid the extra whitespace when using template tags? |
Thanks for the report, @Techn1x. I was able to reproduce consistently. Looking into this now. It seems to be specific to format-on-save. |
im seeing weird issues where, if you have a JSDoc comment with a type annotation with an object:
this breaks the prettier plugin
something about the double-curly in the comment block is throwing off prettier, because when i delete that line it works fine |
Thanks for the report @hmajoros. Can you move this to a top-level issue? It seems like a big deal. I might not be able to debug for a few weeks, unfortunately, but hopefully someone else will have time. |
Just confirming that it's definitely prettier (and not something like editorconfig, or eslint autofix, or whatever). I added So it seems like there's 2 issues;
|
🐞 Describe the Bug
When initial saving the following template
the following will result
It adds a new line after the content block
🔬 Minimal Reproduction
I am trying to make a reproduction, but it seems to only happen in my environment via the vscode plugin
😕 Actual Behavior
Adds a new line in comment
🤔 Expected Behavior
Do not add a new line in comment block
🌍 Environment
The text was updated successfully, but these errors were encountered: