3
3
* Licensed under the MIT License.
4
4
*/
5
5
6
- // Disabling these per-file rather than full subdirectory
7
- /* eslint-disable @typescript-eslint/no-misused-promises */
8
-
9
6
import * as assert from "assert" ;
10
7
import {
11
8
ITelemetryBaseLogger ,
@@ -118,8 +115,7 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
118
115
request ,
119
116
logger ) ;
120
117
121
- // eslint-disable-next-line no-async-promise-executor
122
- return new Promise < Container > ( async ( res , rej ) => {
118
+ return new Promise < Container > ( ( res , rej ) => {
123
119
let alreadyRaisedError = false ;
124
120
const onError = ( error ) => {
125
121
container . removeListener ( "error" , onError ) ;
@@ -135,8 +131,7 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
135
131
const version = request . headers && request . headers [ LoaderHeader . version ] ;
136
132
const pause = request . headers && request . headers [ LoaderHeader . pause ] ;
137
133
138
- // tslint:disable-next-line no-unsafe-any
139
- return container . load ( version , ! ! pause )
134
+ container . load ( version , ! ! pause )
140
135
. then ( ( ) => {
141
136
container . removeListener ( "error" , onError ) ;
142
137
res ( container ) ;
@@ -156,10 +151,6 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
156
151
157
152
private pendingClientId : string | undefined ;
158
153
private loaded = false ;
159
- // TSLint incorrectly believes blobManager is not reassigned, but actually it is in load().
160
- // Known bug: https://github.com/palantir/tslint/issues/3803
161
- // Fixed in ESLint: https://github.com/typescript-eslint/typescript-eslint/issues/946
162
- // tslint:disable-next-line:prefer-readonly
163
154
private blobManager : BlobManager | undefined ;
164
155
165
156
// Active chaincode and associated runtime
@@ -179,10 +170,6 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
179
170
private context : ContainerContext | undefined ;
180
171
private pkg : string | IFluidCodeDetails | undefined ;
181
172
private codeQuorumKey ;
182
- // TSLint incorrectly believes protocolHandler is not reassigned, but actually it is in load().
183
- // Known bug: https://github.com/palantir/tslint/issues/3803
184
- // Fixed in ESLint: https://github.com/typescript-eslint/typescript-eslint/issues/946
185
- // tslint:disable-next-line:prefer-readonly
186
173
private protocolHandler : ProtocolOpHandler | undefined ;
187
174
188
175
private firstConnection = true ;
@@ -349,7 +336,6 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
349
336
public on ( event : "pong" | "processTime" , listener : ( latency : number ) => void ) : this;
350
337
public on ( event : MessageType . BlobUploaded , listener : ( contents : any ) => void ) : this;
351
338
352
- /* tslint:disable:no-unnecessary-override */
353
339
public on ( event : string | symbol , listener : ( ...args : any [ ] ) => void ) : this {
354
340
return super . on ( event , listener ) ;
355
341
}
@@ -431,8 +417,7 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
431
417
this . emit ( "error" , error ) ;
432
418
}
433
419
434
- // eslint-disable-next-line @typescript-eslint/promise-function-async
435
- public reloadContext ( ) : Promise < void > {
420
+ public async reloadContext ( ) : Promise < void > {
436
421
return this . reloadContextCore ( ) . catch ( ( error ) => {
437
422
this . raiseCriticalError ( error ) ;
438
423
throw error ;
@@ -770,7 +755,6 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
770
755
} ) ;
771
756
772
757
protocol . quorum . on ( "error" , ( error ) => {
773
- // tslint:disable-next-line no-unsafe-any
774
758
protocolLogger . sendErrorEvent ( error ) ;
775
759
} ) ;
776
760
@@ -877,9 +861,7 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
877
861
}
878
862
879
863
private get client ( ) {
880
- // tslint:disable-next-line:no-unsafe-any
881
864
const client : IClient = this . options && this . options . client
882
- // tslint:disable-next-line:no-unsafe-any
883
865
? ( this . options . client as IClient )
884
866
: {
885
867
type : "browser" , // Back-compat: 0.11 clientType
@@ -896,7 +878,6 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
896
878
&& this . originalRequest . headers [ LoaderHeader . clientDetails ] ;
897
879
898
880
if ( headerClientDetails ) {
899
- // tslint:disable-next-line: no-unsafe-any
900
881
merge ( client . details , headerClientDetails ) ;
901
882
}
902
883
@@ -1145,13 +1126,10 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
1145
1126
}
1146
1127
}
1147
1128
1148
- // tslint:disable no-unsafe-any
1149
1129
private getScopes ( options : any ) : string [ ] {
1150
1130
return options && options . tokens && options . tokens . jwt ?
1151
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
1152
- ( jwtDecode ( options . tokens . jwt ) as ITokenClaims ) . scopes : [ ] ;
1131
+ jwtDecode < ITokenClaims > ( options . tokens . jwt ) . scopes : [ ] ;
1153
1132
}
1154
- // tslint:enable no-unsafe-any
1155
1133
1156
1134
/**
1157
1135
* Get the most recent snapshot, or a specific version.
@@ -1198,8 +1176,7 @@ export class Container extends EventEmitterWithErrorHandling implements IContain
1198
1176
( err ) => this . raiseCriticalError ( err ) ,
1199
1177
( type , contents ) => this . submitMessage ( type , contents ) ,
1200
1178
( message ) => this . submitSignal ( message ) ,
1201
- // eslint-disable-next-line @typescript-eslint/promise-function-async
1202
- ( message ) => this . snapshot ( message ) ,
1179
+ async ( message ) => this . snapshot ( message ) ,
1203
1180
( reason ?: string ) => this . close ( reason ) ,
1204
1181
Container . version ,
1205
1182
) ;
0 commit comments