eslint-plugin-vue
eslint-plugin-vue copied to clipboard
Rule proposal: newline between same level html elements
Please describe what the rule should do:
Enforce newline between same level HTML elements.
What category should the rule belong to?
- [x] Enforces code style
- [ ] Warns about a potential error
- [ ] Suggests an alternate way of doing something
- [ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
<template>
<div>content</div>
<CustomElement />
<div>
<div>content</div>
<CustomElement />
</div>
</template>
Additional context
I think this really helps code readability. Maybe for some reasons this can be a bad practice. Ether way there shell be a rule to enforce or prevents this.
Hi @kailniris Thank you for this proposition. However this will never be white or black and in this case I think we should just follow common sense. Using one or the other approach exclusively might produce actually worse code. I'll leave this open for now, as I would love to see what others might think about it. But nevertheless it would most likely never go to any category, but remain uncategorized instead.
This should now be possible with the vue/padding-line-between-tags rule (added in #1966).