File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Check if there are no side effects inside computed properties (no-async-in-computed-properties)
2
+
3
+ Check if there are no side effects inside computed properties
4
+
5
+
6
+ ## :book : Rule Details
7
+
8
+ This rule tries to check if there are no side effects inside computed properties.
9
+
10
+ This rule aims to...
11
+
12
+ :-1 : Examples of ** incorrect** code for this rule:
13
+
14
+ ``` js
15
+ computed: {
16
+ foo : async function () {
17
+ return await someFunc ()
18
+ }
19
+ }
20
+ ```
21
+
22
+ ``` js
23
+ computed: {
24
+ foo () {
25
+ return new Promise ((resolve , reject ) => {})
26
+ }
27
+ }
28
+ ```
29
+
30
+ ``` js
31
+ computed: {
32
+ foo () {
33
+ return fetch (url).then (response => {})
34
+ }
35
+ }
36
+ ```
37
+
38
+ :+1 : Examples of ** correct** code for this rule:
39
+
40
+ ``` js
41
+ computed: {
42
+ foo () {
43
+ return this .a + this .b
44
+ }
45
+ }
46
+ ```
47
+
48
+ ## :wrench : Options
49
+
50
+ Nothing.
You can’t perform that action at this time.
0 commit comments