Skip to content

Commit 71aa2ea

Browse files
cartantbenlesh
authored andcommitted
chore: disable suppressImplicitAnyIndexErrors (ReactiveX#5248)
1 parent 8b15da1 commit 71aa2ea

26 files changed

Lines changed: 89 additions & 90 deletions

spec/helpers/interop-helper-spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { asInteropObservable, asInteropSubscriber } from './interop-helper';
66

77
describe('interop helper', () => {
88
it('should simulate interop observables', () => {
9-
const observable = asInteropObservable(of(42));
9+
const observable: any = asInteropObservable(of(42));
1010
expect(observable).to.not.be.instanceOf(Observable);
1111
expect(observable[symbolObservable]).to.be.a('function');
1212
});
1313

1414
it('should simulate interop subscribers', () => {
15-
const subscriber = asInteropSubscriber(new Subscriber());
15+
const subscriber: any = asInteropSubscriber(new Subscriber());
1616
expect(subscriber).to.not.be.instanceOf(Subscriber);
1717
expect(subscriber[symbolSubscriber]).to.be.undefined;
1818
});

spec/helpers/test-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as sinon from 'sinon';
88
import { expect } from 'chai';
99

1010
export function lowerCaseO<T>(...args: Array<any>): Observable<T> {
11-
const o = {
11+
const o: any = {
1212
subscribe(observer: any) {
1313
args.forEach(v => observer.next(v));
1414
observer.complete();

spec/helpers/testScheduler-ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ if (global.Mocha) {
264264
//overrides JSON.toStringfy to serialize error object
265265
Object.defineProperty(Error.prototype, 'toJSON', {
266266
value: function (this: any) {
267-
const alt = {};
267+
const alt: Record<string, any> = {};
268268

269269
Object.getOwnPropertyNames(this).forEach(function (this: any, key: string) {
270270
if (key !== 'stack') {

spec/observables/dom/ajax-spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ class MockXMLHttpRequest {
12421242
this.triggerEvent('readystatechange');
12431243
}
12441244

1245-
triggerEvent(name: any, eventObj?: any): void {
1245+
triggerEvent(this: any, name: any, eventObj?: any): void {
12461246
// TODO: create a better default event
12471247
const e: any = eventObj || { type: name };
12481248

@@ -1251,7 +1251,7 @@ class MockXMLHttpRequest {
12511251
}
12521252
}
12531253

1254-
triggerUploadEvent(name: any, eventObj?: any): void {
1254+
triggerUploadEvent(this: any, name: any, eventObj?: any): void {
12551255
// TODO: create a better default event
12561256
const e: any = eventObj || {};
12571257

@@ -1285,7 +1285,7 @@ class MockXMLHttpRequestInternetExplorer extends MockXMLHttpRequest {
12851285
return super.defaultResponseValue();
12861286
}
12871287

1288-
triggerUploadEvent(name: any, eventObj?: any): void {
1288+
triggerUploadEvent(this: any, name: any, eventObj?: any): void {
12891289
// TODO: create a better default event
12901290
const e: any = eventObj || {};
12911291
if (this['on' + name]) {

spec/observables/dom/fetch-spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,17 @@ describe('fromFetch', () => {
184184
expect(MockAbortController.created).to.equal(0);
185185
let subscription = fetch$.subscribe();
186186
expect(MockAbortController.created).to.equal(1);
187-
expect(mockFetch.calls[0].init.signal.aborted).to.be.false;
187+
expect(mockFetch.calls[0].init!.signal!.aborted).to.be.false;
188188

189189
subscription.unsubscribe();
190-
expect(mockFetch.calls[0].init.signal.aborted).to.be.true;
190+
expect(mockFetch.calls[0].init!.signal!.aborted).to.be.true;
191191

192192
subscription = fetch$.subscribe();
193193
expect(MockAbortController.created).to.equal(2);
194-
expect(mockFetch.calls[1].init.signal.aborted).to.be.false;
194+
expect(mockFetch.calls[1].init!.signal!.aborted).to.be.false;
195195

196196
subscription.unsubscribe();
197-
expect(mockFetch.calls[1].init.signal.aborted).to.be.true;
197+
expect(mockFetch.calls[1].init!.signal!.aborted).to.be.true;
198198
});
199199

200200
it('should allow passing of init object', done => {

spec/observables/dom/webSocket-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ class MockWebSocket {
771771
}
772772
}
773773

774-
trigger(name: string, e: any) {
774+
trigger(this: any, name: string, e: any) {
775775
if (this['on' + name]) {
776776
this['on' + name](e);
777777
}

spec/observables/from-spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('from', () => {
6363
});
6464

6565
const fakeArrayObservable = <T>(...values: T[]) => {
66-
let arr = ['bad array!'];
66+
let arr: any = ['bad array!'];
6767
arr[observable] = () => {
6868
return {
6969
subscribe: (observer: Observer<T>) => {
@@ -140,7 +140,7 @@ describe('from', () => {
140140
});
141141
it(`should accept a function`, (done) => {
142142
const subject = new Subject();
143-
const handler = (...args: any[]) => subject.next(...args);
143+
const handler: any = (...args: any[]) => subject.next(...args);
144144
handler[observable] = () => subject;
145145
let nextInvoked = false;
146146

spec/operators/concatMap-spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('Observable.prototype.concatMap', () => {
9494
const e1subs = '^ ! ';
9595
const expected = '--a-a-a-a---b--b--b-------c-c-c-----(d|)';
9696

97-
const observableLookup = { a: a, b: b, c: c, d: d };
97+
const observableLookup: Record<string, Observable<string>> = { a: a, b: b, c: c, d: d };
9898
const source = e1.pipe(concatMap((value) => observableLookup[value]));
9999

100100
expectObservable(source).toBe(expected);
@@ -324,7 +324,7 @@ describe('Observable.prototype.concatMap', () => {
324324
const e1 = hot('-a-b--^-c-----d------e----------------f-----g| ');
325325
const e1subs = '^ ! ';
326326
const expected = '---2--3--4--5----6-----2--3-1------2--3-4-5--------1-2|';
327-
const observableLookup = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
327+
const observableLookup: Record<string, Observable<string>> = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
328328

329329
const result = e1.pipe(concatMap((value) => observableLookup[value]));
330330

@@ -357,7 +357,7 @@ describe('Observable.prototype.concatMap', () => {
357357
const e1 = hot('-a-b--^-c-----d------e----------------f-----g| ');
358358
const e1subs = '^ ! ' ;
359359
const expected = '---2--3--4--5----6-----2--3----------------------------';
360-
const observableLookup = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
360+
const observableLookup: Record<string, Observable<string>> = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
361361

362362
const result = e1.pipe(concatMap((value) => observableLookup[value]));
363363

@@ -390,7 +390,7 @@ describe('Observable.prototype.concatMap', () => {
390390
const e1 = hot('-a-b--^-c-----d------e----------------f-----g--- ');
391391
const e1subs = '^ ';
392392
const expected = '---2--3--4--5----6-----2--3-1------2--3-4-5--------1-2-';
393-
const observableLookup = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
393+
const observableLookup: Record<string, Observable<string>> = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
394394

395395
const result = e1.pipe(concatMap((value) => observableLookup[value]));
396396

@@ -423,7 +423,7 @@ describe('Observable.prototype.concatMap', () => {
423423
const e1 = hot('-a-b--^-c-----d------e----------------f-----g# ');
424424
const e1subs = '^ ! ';
425425
const expected = '---2--3--4--5----6-----2--3-1------2--3# ';
426-
const observableLookup = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
426+
const observableLookup: Record<string, Observable<string>> = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
427427

428428
const result = e1.pipe(concatMap((value) => observableLookup[value]));
429429

@@ -456,7 +456,7 @@ describe('Observable.prototype.concatMap', () => {
456456
const e1 = hot('-a-b--^-c-----d------e----------------f-----g| ');
457457
const e1subs = '^ ! ';
458458
const expected = '---2--3--4--5----6-# ';
459-
const observableLookup = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
459+
const observableLookup: Record<string, Observable<string>> = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
460460

461461
const result = e1.pipe(concatMap((value) => observableLookup[value]));
462462

@@ -490,7 +490,7 @@ describe('Observable.prototype.concatMap', () => {
490490
const e1subs = '^ ! ';
491491
const unsub = ' ! ';
492492
const expected = '---2--3--4--5----6-----2--3-1-- ';
493-
const observableLookup = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
493+
const observableLookup: Record<string, Observable<string>> = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
494494

495495
const result = e1.pipe(concatMap((value) => observableLookup[value]));
496496

@@ -524,7 +524,7 @@ describe('Observable.prototype.concatMap', () => {
524524
const e1subs = '^ ! ';
525525
const unsub = ' ! ';
526526
const expected = '---2--3--4--5----6-----2--3-1-- ';
527-
const observableLookup = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
527+
const observableLookup: Record<string, Observable<string>> = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
528528

529529
const result = e1.pipe(
530530
mergeMap(x => of(x)),
@@ -561,7 +561,7 @@ describe('Observable.prototype.concatMap', () => {
561561
const e1 = hot('-a-b--^-c-----d------e----------------f-----g| ');
562562
const e1subs = '^ ! ';
563563
const expected = '---2--3--4--5----6-----2--3# ';
564-
const observableLookup = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
564+
const observableLookup: Record<string, Observable<string>> = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };
565565

566566
const result = e1.pipe(
567567
concatMap((value) => {

spec/operators/exhaustMap-spec.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ describe('exhaustMap', () => {
142142
const e1subs = '^ !';
143143
const expected = '-----a--b--c---------------------g--h--i-----|';
144144

145-
const observableLookup = { x: x, y: y, z: z };
145+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y, z: z };
146146

147147
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
148148

@@ -165,7 +165,7 @@ describe('exhaustMap', () => {
165165
const e1subs = '^ ! ';
166166
const expected = '-----a--b--c---------------------g- ';
167167

168-
const observableLookup = { x: x, y: y, z: z };
168+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y, z: z };
169169

170170
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
171171

@@ -188,7 +188,7 @@ describe('exhaustMap', () => {
188188
const expected = '-----a--b--c---------------------g- ';
189189
const unsub = ' ! ';
190190

191-
const observableLookup = { x: x, y: y, z: z };
191+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y, z: z };
192192

193193
const result = e1.pipe(
194194
mergeMap(x => of(x)),
@@ -215,7 +215,7 @@ describe('exhaustMap', () => {
215215
const expected = '-----a--b--c---------------------g- ';
216216
const unsub = ' ! ';
217217

218-
const observableLookup = { x: x, y: y, z: z };
218+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y, z: z };
219219

220220
// This test is the same as the previous test, but the observable is
221221
// manipulated to make it look like an interop observable - an observable
@@ -272,7 +272,7 @@ describe('exhaustMap', () => {
272272
const e1subs = '^ ! ';
273273
const expected = '-----a--b--c---------------------g--h--i-----';
274274

275-
const observableLookup = { x: x, y: y, z: z };
275+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y, z: z };
276276

277277
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
278278

@@ -292,7 +292,7 @@ describe('exhaustMap', () => {
292292
const e1subs = '^ !';
293293
const expected = '-----------a--b--c--d--e-----|';
294294

295-
const observableLookup = { x: x, y: y };
295+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };
296296

297297
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
298298

@@ -311,7 +311,7 @@ describe('exhaustMap', () => {
311311
const e1subs = '^ ! ';
312312
const expected = '-----------a--b--c--d--# ';
313313

314-
const observableLookup = { x: x, y: y };
314+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };
315315

316316
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
317317

@@ -332,7 +332,7 @@ describe('exhaustMap', () => {
332332
const e1subs = '^ ! ';
333333
const expected = '-----------c--d--e-----j---k---l---m--|';
334334

335-
const observableLookup = { x: x, y: y, z: z };
335+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y, z: z };
336336

337337
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
338338

@@ -352,7 +352,7 @@ describe('exhaustMap', () => {
352352
const e1subs = '^ !';
353353
const expected = '-----------------------------|';
354354

355-
const observableLookup = { x: x, y: y };
355+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };
356356

357357
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
358358

@@ -371,7 +371,7 @@ describe('exhaustMap', () => {
371371
const e1subs = '^ !';
372372
const expected = '------------------------------';
373373

374-
const observableLookup = { x: x, y: y };
374+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };
375375

376376
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
377377

@@ -390,7 +390,7 @@ describe('exhaustMap', () => {
390390
const e1subs = '^ !';
391391
const expected = '-------------------------------';
392392

393-
const observableLookup = { x: x, y: y };
393+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };
394394

395395
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
396396

@@ -409,7 +409,7 @@ describe('exhaustMap', () => {
409409
const e1subs = '^ ! ';
410410
const expected = '-------------------# ';
411411

412-
const observableLookup = { x: x, y: y };
412+
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };
413413

414414
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
415415

@@ -426,7 +426,7 @@ describe('exhaustMap', () => {
426426
const e1subs = '^ ! ';
427427
const expected = '-----------a--b--c-# ';
428428

429-
const observableLookup = { x: x };
429+
const observableLookup: Record<string, Observable<string>> = { x: x };
430430

431431
const result = e1.pipe(exhaustMap(value => observableLookup[value]));
432432

spec/operators/expand-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ describe('expand operator', () => {
368368
return <any>EMPTY;
369369
}
370370

371-
const ish = {
371+
const ish: any = {
372372
subscribe: (observer: Observer<number>) => {
373373
observer.next(x + x);
374374
observer.complete();

0 commit comments

Comments
 (0)