Pug plugin doesn't work for the .vue files
See original GitHub issueEnvironments:
- Prettier Version: 1.18.2
- Running Prettier via: CLI
- Runtime: node.js v8.15.0
- Operating System: MacOS
Steps to reproduce:
- clone https://github.com/xorik/prettier-pug-vue
- run
prettier --write *.vue
Expected behavior:
Template inside the pug.vue
should be prettified
Actual behavior:
template inside the pug.vue
isn’t touched by prettier
If you run prettier --write *.pug
, you can see that the plugin itself works perfectly.
The plugin developers suggested to write here: (https://github.com/prettier/plugin-pug/issues/5)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:26 (19 by maintainers)
Top Results From Across the Web
Vue plugin misbehaving when used with Pug
Explanation of the problem. The Pug code in your question doesn't result in the same HTML as your "Working code." (At least in...
Read more >vue-pug-plugin
Pug to HTML plugin for Vue with proper native pug syntax support. Latest version: 2.0.3, last published: 2 months ago.
Read more >Pug.js tutorial: A beginner's guide with examples
In this Pug.js tutorial, we'll show you how to integrate Vue.js into a backend app using Pug as a templating engine and Express.js....
Read more >Vue JavaScript Tutorial in Visual Studio Code
Vue JavaScript tutorial showing IntelliSense, debugging, and code navigation support in the Visual Studio Code editor.
Read more >Using Pre-Processors - Vue Loader
Any content inside the block will be processed by webpack as if it's inside a *.scss file. # Sass vs SCSS. Note that...
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
/cc @prettier/core thoughts?
👋, @prettier/core team! I may have found a hint for people wanting to use
@prettier/plugin-pug
and Vue templates.https://github.com/prettier/prettier/issues/5371 references a time when there were troubles with Vue templates written with Pug, Prettier formatting Pug templates as HTML templates.
As far as I understand, it got fixed by ignoring
template
tags with alang
attribute different tohtml
thanks to ashouldPreserveElementContent
function: https://github.com/prettier/prettier/pull/5388/files#diff-0558c7e4048f9cad5b9156aecca77883R40-R47Should a modification be done directly to
shouldPreserveElementContent
inprettier/language-html/utils
to check for other kind of templating engines depending on the plugins installed?Or in
prettier/language-html/syntax-vue
?@Shinigami92 (maintainer of
@prettier/plugin-pug
) also suggested in https://github.com/prettier/plugin-pug/issues/5#issuecomment-536993369:I would be happy to help for this issue, but I don’t know where to start (yet)! 💯