eslint-plugin-vue
eslint-plugin-vue copied to clipboard
Push each HTML element onto a new line
Im sorry to be asking what might be an obvious question but is there a way to force each HTML element onto a new line? The rules i come across seem to be related to content as opposed to the whole element. For ex:
// BAD
<div>helloworld</div><div>Hello world 2</div>
// ALSO BAD
<div>helloworld</div><div>
Hello world 2
</div>
// GOOD
<div>helloworld</div>
<div>Hello world 2</div>
Prettier does this however I am trying to ditch prettier because of how much it conflicts with eslint vue rules and I would prefer more control over the linting.
I have tried "vue/singleline-html-element-content-newline" but that turns this:
<h1>{{ msg }}</h1> <div>test</div>
// BECOMES THIS
<h1>
{{ msg }}
</h1> <div>
test
</div>
I would like the div on be on a newline and i also think that attribute is more for targetting the content and not each element. I guess i am looking for something like "vue/singleline-html-element-newline" ?
No takers on this one? Is it more complicated?
@rezelute have you got any solution? I'm thinking of creating a PR for this rule