vue/padding-line-between-tags β
require or disallow newlines between sibling tags in template
- π§ The
--fixoption on the command line can automatically fix some of the problems reported by this rule.
π Rule Details β
This rule requires or disallows newlines between sibling HTML tags.
π§ Options β
{
"vue/padding-line-between-tags": ["error", [
{ "blankLine": "always", "prev": "*", "next": "*" }
]]
}This rule requires blank lines between each sibling HTML tag by default.
A configuration is an object which has 3 properties; blankLine, prev and next. For example, { blankLine: "always", prev: "br", next: "div" } means βone or more blank lines are required between a br tag and a div tag.β You can supply any number of configurations. If a tag pair matches multiple configurations, the last matched configuration will be used.
blankLineis one of the following:alwaysrequires one or more blank lines.neverdisallows blank lines.consistentrequires or disallows a blank line based on the first sibling element.
prevany tag name without brackets.nextany tag name without brackets.
Disallow blank lines between all tags β
{ blankLine: 'never', prev: '*', next: '*' }
Require newlines after <br> β
{ blankLine: 'always', prev: 'br', next: '*' }
Require newlines between <br> and <img> β
{ blankLine: 'always', prev: 'br', next: 'img' }
Require consistent newlines β
{ blankLine: 'consistent', prev: '*', next: '*' }
π Version β
This rule was introduced in eslint-plugin-vue v9.5.0