From: BO41 Date: Wed, 24 Oct 2018 19:50:18 +0000 (+0200) Subject: add noImplicitThis flag (#1324) X-Git-Tag: v1.1.0-rc.1~68 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=951ef8294e9eae8f0b42292059daf0c972dbc48f;p=oweals%2Fpeertube.git add noImplicitThis flag (#1324) --- diff --git a/client/src/app/videos/+video-watch/comment/linkifier.service.ts b/client/src/app/videos/+video-watch/comment/linkifier.service.ts index 4f4ec1e5d..2529c9eaf 100644 --- a/client/src/app/videos/+video-watch/comment/linkifier.service.ts +++ b/client/src/app/videos/+video-watch/comment/linkifier.service.ts @@ -41,7 +41,7 @@ export class LinkifierService { const TT_UNDERSCORE = TT.UNDERSCORE const TT_DOT = TT.DOT - function MENTION (value: any) { + function MENTION (this: any, value: any) { this.v = value } diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 65b974037..dda870905 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -435,7 +435,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { const self = this this.zone.runOutsideAngular(async () => { - videojs(this.playerElement, videojsOptions, function () { + videojs(this.playerElement, videojsOptions, function (this: videojs.Player) { self.player = this this.on('customError', ({ err }: { err: any }) => self.handleError(err)) diff --git a/client/src/assets/player/peertube-player.ts b/client/src/assets/player/peertube-player.ts index db63071cb..aaa1170b6 100644 --- a/client/src/assets/player/peertube-player.ts +++ b/client/src/assets/player/peertube-player.ts @@ -213,7 +213,7 @@ function addContextMenu (player: any, videoEmbedUrl: string) { { label: player.localize('Copy the video URL at the current time'), listener: function () { - const player = this + const player = this as Player copyToClipboard(buildVideoLink(player.currentTime())) } }, @@ -226,7 +226,7 @@ function addContextMenu (player: any, videoEmbedUrl: string) { { label: player.localize('Copy magnet URI'), listener: function () { - const player = this + const player = this as Player copyToClipboard(player.peertube().getCurrentVideoFile().magnetUri) } } diff --git a/client/src/assets/player/settings-menu-button.ts b/client/src/assets/player/settings-menu-button.ts index aa7281727..a7aefdcc3 100644 --- a/client/src/assets/player/settings-menu-button.ts +++ b/client/src/assets/player/settings-menu-button.ts @@ -182,7 +182,7 @@ class SettingsButton extends Button { } addMenuItem (entry: any, options: any) { - const openSubMenu = function () { + const openSubMenu = function (this: any) { if (videojsUntyped.dom.hasClass(this.el_, 'open')) { videojsUntyped.dom.removeClass(this.el_, 'open') } else { diff --git a/client/tsconfig.json b/client/tsconfig.json index ef80445db..beca79e01 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -8,6 +8,7 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "noImplicitAny": true, + "noImplicitThis": true, "suppressImplicitAnyIndexErrors":true, "alwaysStrict": true, "target": "es5",