@@ -8,25 +8,49 @@ This rule enforces a line break (or no line break) before tag's closing brackets
8
8
9
9
``` html
10
10
<div
11
- id =" foo"
12
- class =" bar" > <!-- On the same line with the last attribute. -->
11
+ id =" foo"
12
+ class =" bar" > <!-- On the same line with the last attribute. -->
13
13
</div >
14
14
15
15
<div
16
- id =" foo"
17
- class =" bar"
16
+ id =" foo"
17
+ class =" bar"
18
18
> <!-- On the next line. -->
19
19
</div >
20
20
```
21
21
22
- ## Rule Details
22
+ ## :book : Rule Details
23
+
24
+ This rule aims to warn the right angle brackets which are at the location other than the configured location.
25
+
26
+ <eslint-code-block :rules =" {'vue/html-closing-bracket-newline': ['error']} " >
27
+ ```
28
+ <template>
29
+ <!-- ✓ GOOD -->
30
+ <div id="foo" class="bar">
31
+ <div
32
+ id="foo"
33
+ class="bar"
34
+ >
35
+
36
+ <!-- ✗ BAD -->
37
+ <div id="foo" class="bar"
38
+ >
39
+ <div
40
+ id="foo"
41
+ class="bar">
42
+ </template>
43
+ ```
44
+ </eslint-code-block >
45
+
46
+ ## :wrench : Options
23
47
24
48
``` json
25
49
{
26
- "vue/html-closing-bracket-newline" : [" error" , {
27
- "singleline" : " never" ,
28
- "multiline" : " always"
29
- }]
50
+ "vue/html-closing-bracket-newline" : [" error" , {
51
+ "singleline" : " never" ,
52
+ "multiline" : " always"
53
+ }]
30
54
}
31
55
```
32
56
@@ -39,51 +63,24 @@ This rule enforces a line break (or no line break) before tag's closing brackets
39
63
40
64
Plus, you can use [ ` vue/html-indent ` ] ( ./html-indent.md ) rule to enforce indent-level of the closing brackets.
41
65
42
- :-1 : Examples of ** incorrect** code for this rule:
43
-
44
- ``` html
45
- <!-- eslint html-closing-bracket-newline: "error" -->
46
-
47
- <div id =" foo" class =" bar"
48
- >
66
+ ### ` { "multiline": "never" } `
49
67
50
- <div
51
- id =" foo"
52
- class =" bar" >
68
+ <eslint-code-block :rules =" {'vue/html-closing-bracket-newline': ['error', { 'multiline': 'never' }]} " >
53
69
```
54
-
55
- :+1 : Examples of ** correct** code for this rule:
56
-
57
- ``` html
58
- <!-- eslint html-closing-bracket-newline: "error" -->
59
-
60
- <div id =" foo" class =" bar" >
61
- <div
70
+ <template>
71
+ <!-- ✓ GOOD -->
72
+ <div
62
73
id="foo"
63
- class =" bar"
64
- >
65
- ```
66
-
67
- :-1 : Examples of ** incorrect** code for ` { "multiline": "never" } ` :
68
-
69
- ``` html
70
- <!-- eslint html-closing-bracket-newline: ["error", { multiline: never }] -->
74
+ class="bar">
71
75
72
- <div
76
+ <!-- ✗ BAD -->
77
+ <div
73
78
id="foo"
74
79
class="bar"
75
- >
76
- ```
77
-
78
- :+1 : Examples of ** correct** code for ` { "multiline": "never" } ` :
79
-
80
- ``` html
81
- <!-- html-closing-bracket-newline: ["error", { multiline: never }] -->
82
-
83
- <div
84
- id =" foo"
85
- class =" bar" >
80
+ >
81
+ </template>
86
82
```
83
+ </eslint-code-block >
87
84
88
85
## :mag : Implementation
89
86
0 commit comments