prettier-ignore comments not working for inline scripts in VSCode
See original GitHub issuePrettier has the ability to ignore blocks of code. https://github.com/prettier/prettier#excluding-code-from-formatting
If you have one of these comments in an inline scripts such as:
<script>
// prettier-ignore
{{ test: "test" }}
</script>
It will not ignore the block.
As far as I am aware prettier does not support inline script tags like this, so I assume prettier-vscode is instructing prettier to format these sections?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Ignoring Code - Prettier
Use .prettierignore to ignore (i.e. not reformat) certain files and folders completely. Use “prettier-ignore” comments to ignore parts of files.
Read more >How to make Prettier to ignore a block of code? - Stack Overflow
While this doesnt work for OP's example, one option is to add the prettier-ignore comment to the start of each line to be...
Read more >vscode prettier ignore not working - You.com | The AI Search ...
It will not ignore the block. As far as I am aware prettier does not support inline script tags like this, so I...
Read more >April 2022 (version 1.67) - Visual Studio Code
Update 1.67.2: The update addresses these issues. ... Behind the scenes, VS Code has supported multiline comments since the comments UX was finalized, ......
Read more >Formatting your source code with Prettier - Packt Subscription
The problem is worsened by the fact that modern JS projects will not only include JS ... a single sentence by preceding it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

What’s this file type? html? What are your settings?
I tried with a html file. It’s not the default formatter as it doesn’t expand collapsed block statements. By default prettier doesn’t run on html. Have you tried with prettier-vscode disabled?
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.