File tree Expand file tree Collapse file tree 1 file changed +34
-3
lines changed Expand file tree Collapse file tree 1 file changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,6 @@ export default {
37
37
38
38
## :wrench : Options
39
39
40
- This rule has an object option:
41
- - ` "treatUndefinedAsUnspecified" ` : ` true ` (default) disallows implicitly returning undefined with a ` return; ` statement.
42
-
43
40
``` json
44
41
{
45
42
"vue/return-in-computed-property" : [2 , {
@@ -48,6 +45,40 @@ This rule has an object option:
48
45
}
49
46
```
50
47
48
+ This rule has an object option:
49
+ - ` "treatUndefinedAsUnspecified" ` : ` true ` (default) disallows implicitly returning undefined with a ` return ` statement.
50
+
51
+ ### ` treatUndefinedAsUnspecified: false `
52
+
53
+ <eslint-code-block :rules =" {'vue/return-in-computed-property': ['error', { treatUndefinedAsUnspecified: false }]} " >
54
+ ``` vue
55
+ <script>
56
+ export default {
57
+ computed: {
58
+ /* ✓ GOOD */
59
+ foo () {
60
+ if (this.bar) {
61
+ return undefined
62
+ } else {
63
+ return
64
+ }
65
+ },
66
+ bar: function () {
67
+ return
68
+ },
69
+ /* ✗ BAD */
70
+ baz () {
71
+ if (this.baf) {
72
+ return this.baf
73
+ }
74
+ },
75
+ baf: function () {}
76
+ }
77
+ }
78
+ </script>
79
+ ```
80
+ </eslint-code-block >
81
+
51
82
## :mag : Implementation
52
83
53
84
- [ Rule source] ( https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/return-in-computed-property.js )
You can’t perform that action at this time.
0 commit comments