Indent <script> and <style> tags’ content in *.vue files #5574
Indent <script> and <style> tags’ content in *.vue files #5574nakatanakatana wants to merge 2 commits intoprettier:masterfrom nakatanakatana:vue-script-indent
Conversation
|
Is it configurable with |
|
@Kocal |
|
Hum okay. |
duailibe
left a comment
There was a problem hiding this comment.
I have no opinion on this.. we just need to choose between people complaining that it's indented vs people complaining that it's NOT indented..
🤷♂️
|
As a member of the Vue team, I personally don't think this should have anything to do with Vue. There does seem to be a huge split on people who prefer an indent or not for embedded languages, but this isn't a Vue-specific thing. It should behave the same everywhere there's XML. |
|
To end bikeshedding on XML indentation for good, maybe it'd be best to just have an option like: "htmlNoIndentTags": ["html", "script", "style"]Then indentation behavior could be the same across XML everywhere, even |
No, then we'd just end the bikeshedding in this repo, moving the bikeshedding to every team using Prettier. See our option philosophy. |
|
@lydell I'm familiar with the option philosophy and one of the cases when you add new configuration is when there's huge demand. I completely understand having to draw a line, so what would sufficiently demonstrate that demand for this is huge enough? In the past, it looks like configuration requests with 30-100 upvotes have been accepted and the issue to resist adding configuration currently has 426 upvotes. |
|
As an aside, my understanding is that another of Prettier's primary goals is consistency (and like any project, maintainability). As an open source maintainer myself, my worry is that special rules for |
ikatyang
left a comment
There was a problem hiding this comment.
Based on the discussion in #3888, we're going to add an option for it and defaults to not indent to avoid unnecessary breaking change.
Could you add an option (maybe --vue-script-indent) for it and document the change in CHANGELOG.unreleased.md?
|
@nakatanakatana are you still around to add the option for this? |
|
@prettier/core It looks like @nakatanakatana is not around.. :) Who can take or of that one? |
|
I can do this |
|
@duailibe and maybe we can start preparing the blog post and the 1.17 release for that? |
azz
left a comment
There was a problem hiding this comment.
I'm confused, why is this Vue-specific?
The proposed option --vue-script-indent doesn't make any sense to me. I thought the issue was about indenting/not-indenting embedded languages in HTML, not just .vue files?
|
@azz I agree, I think it makes the most sense to have an option for indent/no-indent for all Also, I’m closing this PR. I think it’s easier to start from scratch now. |
Fixes #3888
docs/directory)✨Try the playground for this PR✨