-
-
Notifications
You must be signed in to change notification settings - Fork 681
[vue/html-indent] unexpected indentation level #293
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
Comments
Hey @rodneyrehm . I'm glad you pointed this! I'll try to look into this :) |
Thank you for this report. Currently, it's intentional behavior -- if the first attribute is not at beginning of the line, the rule aligns rest attributes to the first attribute. This supports the following-like style: <div id="foo"
class="abc"
style="font-color: red;"> I think we can add an option about this behavior. |
Ok, I spent some time on it, and I found a way to improve this rule. PR is on it's way :) <section v-for="n in list"
:key="n"
class="delta"
>
</section> |
For what it's worth, I think
is easier to read... After upgrading, having the recommended settings format my entire project to the other formatting style gave me a panic attack. I quite liked the way I wrote the code originally, and now I sort of want prettier/eslint to get out of my way. |
Tell us about your environment
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
I expect the template to be considered valid.
What actually happened? Please include the actual, raw output from ESLint.
Note how the indentation of
class="bravo"
andclass="delta"
is fine, butclass="charlie"
is somehow trying to align with thev-for="…"
on the previous line.We tend to keep properties
v-if
,v-else-if
,v-else
,v-for
,key
andis
on the same line as the opening element, where the remaining properties are spread onto their own lines. I understand the fix for my problem is to move all attributes off the opening line, but the current behavior remains unexpected.The text was updated successfully, but these errors were encountered: