File tree Expand file tree Collapse file tree 1 file changed +91
-5
lines changed Expand file tree Collapse file tree 1 file changed +91
-5
lines changed Original file line number Diff line number Diff line change @@ -13,21 +13,107 @@ description: enforce empty lines between top-level options
13
13
14
14
## :book : Rule Details
15
15
16
- This rule ... .
16
+ This rule enforces consistent format of empty lines between Vue component options by either adding or removing them .
17
17
18
- <eslint-code-block fix :rules =" {'vue/empty-line-between-options': ['error']} " >
18
+ <eslint-code-block fix :rules =" {'vue/empty-line-between-options': ['error', 'always' ]} " >
19
19
20
20
``` vue
21
- <template>
21
+ <script>
22
+ <!-- ✓ GOOD -->
23
+ export default {
24
+ name: 'a-button',
22
25
23
- </template>
26
+ /**
27
+ * Ceci n'est pas un commentaire
28
+ * @return {{}}
29
+ */
30
+ data() {
31
+ return {
32
+ // ...
33
+ }
34
+ },
35
+
36
+ computed: {
37
+ // ...
38
+ }
39
+ }
40
+
41
+ <!-- ✗ BAD -->
42
+ export default {
43
+ name: 'a-button',
44
+ /**
45
+ * Ceci n'est pas un commentaire
46
+ * @return {{}}
47
+ */
48
+ data() {
49
+ return {
50
+ // ...
51
+ }
52
+ },
53
+ computed: {
54
+ // ...
55
+ }
56
+ }
57
+ </script>
24
58
```
25
59
26
60
</eslint-code-block >
27
61
62
+ <eslint-code-block fix :rules =" {'vue/empty-line-between-options': ['error', 'never']} " >
63
+
64
+ ``` vue
65
+ <script>
66
+ <!-- ✓ GOOD -->
67
+ export default {
68
+ name: 'a-button',
69
+ /**
70
+ * Ceci n'est pas un commentaire
71
+ * @return {{}}
72
+ */
73
+ data() {
74
+ return {
75
+ // ...
76
+ }
77
+ },
78
+ computed: {
79
+ // ...
80
+ }
81
+ }
82
+
83
+ <!-- ✗ BAD -->
84
+ export default {
85
+ name: 'a-button',
86
+
87
+ /**
88
+ * Ceci n'est pas un commentaire
89
+ * @return {{}}
90
+ */
91
+ data() {
92
+ return {
93
+ // ...
94
+ }
95
+ },
96
+
97
+ computed: {
98
+ // ...
99
+ }
100
+ }
101
+ </script>
102
+ ```
103
+
104
+ </eslint-code-block >
105
+
106
+
28
107
## :wrench : Options
29
108
30
- Nothing.
109
+ ``` json
110
+ {
111
+ "vue/empty-line-between-options" : [" error" , " always" | "never" ]
112
+ }
113
+ ```
114
+
115
+ - ` "always" ` (default) ... add an empty line between options.
116
+ - ` "never" ` ... remove empty lines between options.
31
117
32
118
## :mag : Implementation
33
119
You can’t perform that action at this time.
0 commit comments