File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
src/docs/guide/usage/linter/rules/typescript Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ While it is valid JavaScript to await a non-Promise-like value (it will resolve
3232
3333Examples of ** incorrect** code for this rule:
3434
35- ``` ts
35+ ```
3636await 12;
3737await (() => {});
3838
@@ -43,15 +43,11 @@ await { then() {} };
4343// this is not a Promise - it's a function that returns a Promise
4444declare const getPromise: () => Promise<string>;
4545await getPromise;
46- await getPromise ;
47- await getPromise ;
48- await getPromise ;
49- await getPromise ;
5046```
5147
5248Examples of ** correct** code for this rule:
5349
54- ``` ts
50+ ```
5551await Promise.resolve("value");
5652await Promise.reject(new Error());
5753
@@ -65,10 +61,6 @@ await {
6561// this is a Promise - produced by calling a function
6662declare const getPromise: () => Promise<string>;
6763await getPromise();
68- await getPromise ();
69- await getPromise ();
70- await getPromise ();
71- await getPromise ();
7264```
7365
7466## How to use
You can’t perform that action at this time.
0 commit comments