Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 462e548

Browse files
Add consistent option to vue/padding-line-between-tags docs (#2003)
1 parent 8b64576 commit 462e548

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

‎docs/rules/padding-line-between-tags.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ This rule requires or disallows newlines between sibling HTML tags.
5252

5353
This rule requires blank lines between each sibling HTML tag by default.
5454

55-
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.
55+
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.
5656

5757
- `blankLine` is one of the following:
5858
- `always` requires one or more blank lines.
5959
- `never` disallows blank lines.
60+
- `consistent` requires or disallows a blank line based on the first sibling element.
6061
- `prev` any tag name without brackets.
6162
- `next` any tag name without brackets.
6263

@@ -106,12 +107,12 @@ A configuration is an object which has 3 properties; blankLine, prev and next. F
106107

107108
</eslint-code-block>
108109

109-
### Require newlines before `<br>`
110+
### Require newlines between `<br>` and `<img>`
110111

111-
`{ blankLine: 'always', prev: '*', next: 'br' }`
112+
`{ blankLine: 'always', prev: 'br', next: 'img' }`
112113

113114
<eslint-code-block fix :rules="{'vue/padding-line-between-tags': ['error', [
114-
{ blankLine: 'always', prev: '*', next: 'br' }
115+
{ blankLine: 'always', prev: 'br', next: 'img' }
115116
]]}">
116117

117118
```vue
@@ -120,8 +121,9 @@ A configuration is an object which has 3 properties; blankLine, prev and next. F
120121
<ul>
121122
<li>
122123
</li>
123-
124124
<br />
125+
126+
<img />
125127
<li>
126128
</li>
127129
</ul>
@@ -131,26 +133,26 @@ A configuration is an object which has 3 properties; blankLine, prev and next. F
131133

132134
</eslint-code-block>
133135

134-
### Require newlines between `<br>` and `<img>`
136+
### Require consistent newlines
135137

136-
`{ blankLine: 'always', prev: 'br', next: 'img' }`
138+
`{ blankLine: 'consistent', prev: '*', next: '*' }`
137139

138140
<eslint-code-block fix :rules="{'vue/padding-line-between-tags': ['error', [
139-
{ blankLine: 'always', prev: 'br', next: 'img' }
141+
{ blankLine: 'consistent', prev: '*', next: '*' }
140142
]]}">
141143

142144
```vue
143145
<template>
144146
<div>
145147
<ul>
146-
<li>
147-
</li>
148-
<br />
149-
150-
<img />
151-
<li>
152-
</li>
148+
<li />
149+
<li />
150+
<li />
153151
</ul>
152+
153+
<div />
154+
155+
<div />
154156
</div>
155157
</template>
156158
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /