File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1+ async function testPromise ( ) {
2+ return new Promise ( ( resolve ) =>
3+ setTimeout ( ( ) => {
4+ console . log ( "done" ) ;
5+ resolve ( "done" ) ;
6+ } , 1 ) ,
7+ ) ;
8+ }
9+
10+ async function check ( ) {
11+ const t = testPromise ( ) ;
12+ if ( ! ! t ) {
13+ console . log ( "there should be an error" ) ;
14+ }
15+
16+ const tt = ( val = "str" ) => t ;
17+
18+ await new Promise < void > ( async ( resolve ) => {
19+ await tt ( ) ;
20+ resolve ( ) ;
21+ } ) ;
22+
23+ console . log ( { foo : 42 , ...tt ( ) } ) ;
24+ }
Original file line number Diff line number Diff line change 66 "extends" : [" ../../.eslintrc.shared.json" ],
77 "rules" : {
88 "@typescript-eslint/naming-convention" : " off" ,
9- "@typescript-eslint/no-floating-promises" : " warn"
9+ "@typescript-eslint/no-floating-promises" : " warn" ,
10+ "@typescript-eslint/no-misused-promises" : " warn"
1011 }
1112}
You can’t perform that action at this time.
0 commit comments