Skip to content

Commit

Permalink
chore: disable suppressImplicitAnyIndexErrors (#5248)
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant authored and benlesh committed Jan 21, 2020
1 parent 8b15da1 commit 71aa2ea
Show file tree
Hide file tree
Showing 26 changed files with 89 additions and 90 deletions.
4 changes: 2 additions & 2 deletions spec/helpers/interop-helper-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { asInteropObservable, asInteropSubscriber } from './interop-helper';

describe('interop helper', () => {
it('should simulate interop observables', () => {
const observable = asInteropObservable(of(42));
const observable: any = asInteropObservable(of(42));
expect(observable).to.not.be.instanceOf(Observable);
expect(observable[symbolObservable]).to.be.a('function');
});

it('should simulate interop subscribers', () => {
const subscriber = asInteropSubscriber(new Subscriber());
const subscriber: any = asInteropSubscriber(new Subscriber());
expect(subscriber).to.not.be.instanceOf(Subscriber);
expect(subscriber[symbolSubscriber]).to.be.undefined;
});
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/test-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as sinon from 'sinon';
import { expect } from 'chai';

export function lowerCaseO<T>(...args: Array<any>): Observable<T> {
const o = {
const o: any = {
subscribe(observer: any) {
args.forEach(v => observer.next(v));
observer.complete();
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/testScheduler-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ if (global.Mocha) {
//overrides JSON.toStringfy to serialize error object
Object.defineProperty(Error.prototype, 'toJSON', {
value: function (this: any) {
const alt = {};
const alt: Record<string, any> = {};

Object.getOwnPropertyNames(this).forEach(function (this: any, key: string) {
if (key !== 'stack') {
Expand Down
6 changes: 3 additions & 3 deletions spec/observables/dom/ajax-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ class MockXMLHttpRequest {
this.triggerEvent('readystatechange');
}

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

Expand All @@ -1251,7 +1251,7 @@ class MockXMLHttpRequest {
}
}

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

Expand Down Expand Up @@ -1285,7 +1285,7 @@ class MockXMLHttpRequestInternetExplorer extends MockXMLHttpRequest {
return super.defaultResponseValue();
}

triggerUploadEvent(name: any, eventObj?: any): void {
triggerUploadEvent(this: any, name: any, eventObj?: any): void {
// TODO: create a better default event
const e: any = eventObj || {};
if (this['on' + name]) {
Expand Down
8 changes: 4 additions & 4 deletions spec/observables/dom/fetch-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,17 @@ describe('fromFetch', () => {
expect(MockAbortController.created).to.equal(0);
let subscription = fetch$.subscribe();
expect(MockAbortController.created).to.equal(1);
expect(mockFetch.calls[0].init.signal.aborted).to.be.false;
expect(mockFetch.calls[0].init!.signal!.aborted).to.be.false;

subscription.unsubscribe();
expect(mockFetch.calls[0].init.signal.aborted).to.be.true;
expect(mockFetch.calls[0].init!.signal!.aborted).to.be.true;

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

subscription.unsubscribe();
expect(mockFetch.calls[1].init.signal.aborted).to.be.true;
expect(mockFetch.calls[1].init!.signal!.aborted).to.be.true;
});

it('should allow passing of init object', done => {
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/dom/webSocket-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ class MockWebSocket {
}
}

trigger(name: string, e: any) {
trigger(this: any, name: string, e: any) {
if (this['on' + name]) {
this['on' + name](e);
}
Expand Down
4 changes: 2 additions & 2 deletions spec/observables/from-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('from', () => {
});

const fakeArrayObservable = <T>(...values: T[]) => {
let arr = ['bad array!'];
let arr: any = ['bad array!'];
arr[observable] = () => {
return {
subscribe: (observer: Observer<T>) => {
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('from', () => {
});
it(`should accept a function`, (done) => {
const subject = new Subject();
const handler = (...args: any[]) => subject.next(...args);
const handler: any = (...args: any[]) => subject.next(...args);
handler[observable] = () => subject;
let nextInvoked = false;

Expand Down
18 changes: 9 additions & 9 deletions spec/operators/concatMap-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('Observable.prototype.concatMap', () => {
const e1subs = '^ ! ';
const expected = '--a-a-a-a---b--b--b-------c-c-c-----(d|)';

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

const result = e1.pipe(
concatMap((value) => {
Expand Down
26 changes: 13 additions & 13 deletions spec/operators/exhaustMap-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('exhaustMap', () => {
const e1subs = '^ !';
const expected = '-----a--b--c---------------------g--h--i-----|';

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

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

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

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

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

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

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

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

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

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

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

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

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

const observableLookup = { x: x, y: y };
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };

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

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

const observableLookup = { x: x, y: y };
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };

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

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

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

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

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

const observableLookup = { x: x, y: y };
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };

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

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

const observableLookup = { x: x, y: y };
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };

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

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

const observableLookup = { x: x, y: y };
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };

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

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

const observableLookup = { x: x, y: y };
const observableLookup: Record<string, Observable<string>> = { x: x, y: y };

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

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

const observableLookup = { x: x };
const observableLookup: Record<string, Observable<string>> = { x: x };

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

Expand Down
2 changes: 1 addition & 1 deletion spec/operators/expand-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ describe('expand operator', () => {
return <any>EMPTY;
}

const ish = {
const ish: any = {
subscribe: (observer: Observer<number>) => {
observer.next(x + x);
observer.complete();
Expand Down
12 changes: 6 additions & 6 deletions spec/operators/groupBy-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ describe('groupBy operator', () => {
return str.split('').reverse().join('');
}

function mapObject(obj: object, fn: Function) {
const out = {};
function mapObject(obj: Record<string, any>, fn: Function) {
const out: Record<string, any> = {};
for (const p in obj) {
if (obj.hasOwnProperty(p)) {
out[p] = fn(obj[p]);
Expand Down Expand Up @@ -607,7 +607,7 @@ describe('groupBy operator', () => {
z: TestScheduler.parseMarbles(z, values)
};

const unsubscriptionFrames = {
const unsubscriptionFrames: Record<string, number> = {
foo: TestScheduler.parseMarblesAsSubscriptions(unsubw).unsubscribedFrame,
bar: TestScheduler.parseMarblesAsSubscriptions(unsubx).unsubscribedFrame,
baz: TestScheduler.parseMarblesAsSubscriptions(unsuby).unsubscribedFrame,
Expand Down Expand Up @@ -1185,14 +1185,14 @@ describe('groupBy operator', () => {
z: TestScheduler.parseMarbles(z, values)
};

const unsubscriptionFrames = {
const unsubscriptionFrames: Record<string, number> = {
foo: TestScheduler.parseMarblesAsSubscriptions(unsubv).unsubscribedFrame,
bar: TestScheduler.parseMarblesAsSubscriptions(unsubw).unsubscribedFrame,
baz: TestScheduler.parseMarblesAsSubscriptions(unsubx).unsubscribedFrame,
qux: TestScheduler.parseMarblesAsSubscriptions(unsuby).unsubscribedFrame,
foo2: TestScheduler.parseMarblesAsSubscriptions(unsubz).unsubscribedFrame
};
const hasUnsubscribed = {};
const hasUnsubscribed: Record<string, boolean> = {};

const source = e1.pipe(
groupBy(
Expand Down Expand Up @@ -1261,7 +1261,7 @@ describe('groupBy operator', () => {
y: TestScheduler.parseMarbles(y, values),
};

const subscriptionFrames = {
const subscriptionFrames: Record<string, number> = {
foo: TestScheduler.parseMarblesAsSubscriptions(subv).subscribedFrame,
bar: TestScheduler.parseMarblesAsSubscriptions(subw).subscribedFrame,
baz: TestScheduler.parseMarblesAsSubscriptions(subx).subscribedFrame,
Expand Down
Loading

0 comments on commit 71aa2ea

Please sign in to comment.