From 244b4ae3973bc1511464a08158a123767f83179c Mon Sep 17 00:00:00 2001 From: BO41 Date: Thu, 18 Oct 2018 09:08:59 +0200 Subject: NoImplicitAny flag true (#1157) this enables the `noImplicitAny` flag in the Typescript compiler > When the noImplicitAny flag is true and the TypeScript compiler cannot infer the type, it still generates the JavaScript files, but it also reports an error. Many seasoned developers prefer this stricter setting because type checking catches more unintentional errors at compile time. closes: #1131 replaces #1137 --- .../my-account-video-channel-update.component.ts | 2 +- .../+my-account/my-account-videos/my-account-videos.component.ts | 9 +++++---- .../video-change-ownership/video-change-ownership.component.ts | 3 ++- client/src/app/+my-account/shared/actor-avatar-info.component.ts | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'client/src/app/+my-account') diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts index 56697030b..f2b8a4e26 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts +++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts @@ -17,7 +17,7 @@ import { VideoChannelValidatorsService } from '@app/shared/forms/form-validators styleUrls: [ './my-account-video-channel-edit.component.scss' ] }) export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelEdit implements OnInit, OnDestroy { - @ViewChild('avatarfileInput') avatarfileInput + @ViewChild('avatarfileInput') avatarfileInput: any error: string diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts index 7560f0128..52307f09e 100644 --- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts +++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts @@ -66,7 +66,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni } isInSelectionMode () { - return Object.keys(this.checkedVideos).some(k => this.checkedVideos[ k ] === true) + return Object.keys(this.checkedVideos).some((k: any) => this.checkedVideos[ k ] === true) } getVideosObservable (page: number) { @@ -81,7 +81,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni async deleteSelectedVideos () { const toDeleteVideosIds = Object.keys(this.checkedVideos) - .filter(k => this.checkedVideos[ k ] === true) + .filter((k: any) => this.checkedVideos[ k ] === true) .map(k => parseInt(k, 10)) const res = await this.confirmService.confirm( @@ -168,9 +168,10 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni } private spliceVideosById (id: number) { - for (const key of Object.keys(this.loadedPages)) { + let key: any + for (key of Object.keys(this.loadedPages)) { const videos = this.loadedPages[ key ] - const index = videos.findIndex(v => v.id === id) + const index = videos.findIndex((v: any) => v.id === id) if (index !== -1) { videos.splice(index, 1) diff --git a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts index 7437b939a..eb3f9404f 100644 --- a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts +++ b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts @@ -49,7 +49,8 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni .catch((_) => _) // Called when closing (cancel) the modal without validating, do nothing } - search (event) { + // TODO: typing + search (event: any) { const query = event.query this.userService.autocomplete(query) .subscribe( diff --git a/client/src/app/+my-account/shared/actor-avatar-info.component.ts b/client/src/app/+my-account/shared/actor-avatar-info.component.ts index 7b80b1ed4..b4505a7f2 100644 --- a/client/src/app/+my-account/shared/actor-avatar-info.component.ts +++ b/client/src/app/+my-account/shared/actor-avatar-info.component.ts @@ -10,7 +10,7 @@ import { Account } from '@app/shared/account/account.model' styleUrls: [ './actor-avatar-info.component.scss' ] }) export class ActorAvatarInfoComponent { - @ViewChild('avatarfileInput') avatarfileInput + @ViewChild('avatarfileInput') avatarfileInput: any @Input() actor: VideoChannel | Account -- cgit v1.2.3