File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,14 @@ const sharedRules = {
5050 // the glob patterns used.
5151 'n/no-unpublished-bin' : 'error' ,
5252 'n/no-unsupported-features/es-builtins' : 'error' ,
53- 'n/no-unsupported-features/es-syntax' : 'error' ,
53+ 'n/no-unsupported-features/es-syntax' : [
54+ 'error' ,
55+ {
56+ ignores : [ 'promise-withresolvers' ] ,
57+ // Lazily access constants.maintainedNodeVersions.
58+ version : constants . maintainedNodeVersions . current
59+ }
60+ ] ,
5461 'n/no-unsupported-features/node-builtins' : [
5562 'error' ,
5663 {
Original file line number Diff line number Diff line change @@ -594,9 +594,9 @@ export class SocketSdk {
594594 ) => {
595595 const {
596596 promise,
597- resolve : resolveFn ,
598- reject : rejectFn
599- } = promiseWithResolvers < GeneratorStep > ( ) ;
597+ reject : rejectFn ,
598+ resolve : resolveFn
599+ } = promiseWithResolvers < GeneratorStep > ( )
600600 running . push ( {
601601 generator,
602602 promise
@@ -1128,14 +1128,19 @@ export class SocketSdk {
11281128 }
11291129}
11301130
1131- function promiseWithResolvers < T > ( ) : ReturnType < typeof Promise . withResolvers < T > > {
1131+ function promiseWithResolvers < T > ( ) : ReturnType <
1132+ typeof Promise . withResolvers < T >
1133+ > {
11321134 if ( Promise . withResolvers ) {
1133- return Promise . withResolvers < T > ( ) ;
1135+ return Promise . withResolvers < T > ( )
11341136 }
11351137
11361138 // This is what the above does but it's not available in node 20 (it is in node 22)
11371139 // @ts -ignore -- sigh.
1138- const obj : ReturnType < typeof Promise . withResolvers < T > > = { } ;
1139- obj . promise = new Promise < T > ( ( resolver , reject ) => { obj . resolve = resolver ; obj . reject = reject ; } ) ;
1140- return obj ;
1140+ const obj : ReturnType < typeof Promise . withResolvers < T > > = { }
1141+ obj . promise = new Promise < T > ( ( resolver , reject ) => {
1142+ obj . resolve = resolver
1143+ obj . reject = reject
1144+ } )
1145+ return obj
11411146}
You can’t perform that action at this time.
0 commit comments