prettier-ignore is ignored
See original GitHub issueThe following snippet of code will get formatted regardless of whether the <!-- prettier-ignore -->
comment is above the line. The standard prettier html parser handles this case.
<script>
// whatever
</script>
<!-- prettier-ignore -->
<span>[</span><span>{value}</span><span>]</span>
<style>
/* whatever */
</style>
The spans need to stay on one line as this component is inside of a <pre>
tag and being on new lines modifies the outcome. (That’s a separate issue that can’t necessarily be handled by #28, so the prettier-ignores
should be respected.)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:40
- Comments:16 (4 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 >prettierignore is not working · Issue #279 - GitHub
I have a simple .prettierignore config that is consumed and applied as expected from ... Prettier: Ignore Path (in vscode) ~/.prettierignore.
Read more >Prettierignore is ignored for subfolders with package.json
prettierignore file in the project root and it specifies a path to a file which is nested to a subfolder with package.json, then...
Read more >How to Ignore all folders with folder pattern using prettier
prettierignore file. -- ignore-path is the path to a file containing patterns that describe files to ignore ; It's not the folder to...
Read more >Ignoring rules | Dev Cheatsheets - Michael Currin
eslint-disable-next-line prettier/prettier console.log('foo'). Global ignore config. A plain text file. .prettierignore e.g.. build/ *.html. Dev Cheatsheets.
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
This would be greatly appreciated…
I just had this issue when trying to inject a dynamic style tag and found this worked, no prettier-ignore required:
My other issue was that postCSS was clobbering the style tag: hiding it in the nested string got around that. Without doing that results in Prettier doing this: