Skip to content

Commit af7d4e6

Browse files
author
barthy
committed
added docs
1 parent ea082d5 commit af7d4e6

File tree

1 file changed

+91
-5
lines changed

1 file changed

+91
-5
lines changed

docs/rules/empty-line-between-options.md

Lines changed: 91 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,107 @@ description: enforce empty lines between top-level options
1313

1414
## :book: Rule Details
1515

16-
This rule ....
16+
This rule enforces consistent format of empty lines between Vue component options by either adding or removing them.
1717

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']}">
1919

2020
```vue
21-
<template>
21+
<script>
22+
<!-- ✓ GOOD -->
23+
export default {
24+
name: 'a-button',
2225
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>
2458
```
2559

2660
</eslint-code-block>
2761

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+
28107
## :wrench: Options
29108

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.
31117

32118
## :mag: Implementation
33119

0 commit comments

Comments
 (0)