Skip to content

Commit 0ddca03

Browse files
committed
Add documentation
1 parent cf66b42 commit 0ddca03

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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.

0 commit comments

Comments
 (0)