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 --- client/src/app/core/auth/auth.service.ts | 2 +- client/src/app/core/server/server.service.ts | 2 +- client/src/app/core/theme/theme.service.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'client/src/app/core') diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index 9c36b946e..5315c8b1d 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts @@ -221,7 +221,7 @@ export class AuthService { } refreshUserInformation () { - const obj = { + const obj: any = { access_token: this.user.getAccessToken(), refresh_token: null, token_type: this.user.getTokenType(), diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index 2f1ef1fc2..1663a052c 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts @@ -155,7 +155,7 @@ export class ServerService { .pipe( switchMap(translations => { return this.http.get(ServerService.BASE_VIDEO_URL + attributeName) - .pipe(map(data => ({ data, translations }))) + .pipe(map((data: any) => ({ data, translations }))) }) ) .subscribe(({ data, translations }) => { diff --git a/client/src/app/core/theme/theme.service.ts b/client/src/app/core/theme/theme.service.ts index a6eef0898..50c19ecac 100644 --- a/client/src/app/core/theme/theme.service.ts +++ b/client/src/app/core/theme/theme.service.ts @@ -5,7 +5,7 @@ import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' export class ThemeService { private theme = document.querySelector('body') private darkTheme = false - private previousTheme = {} + private previousTheme: { [ id: string ]: string } = {} constructor () { // initialise the alternative theme with dark theme colors @@ -33,7 +33,7 @@ export class ThemeService { } } - private switchProperty (property, newValue?) { + private switchProperty (property: string, newValue?: string) { const propertyOldvalue = window.getComputedStyle(this.theme).getPropertyValue('--' + property) this.theme.style.setProperty('--' + property, (newValue) ? newValue : this.previousTheme[property]) this.previousTheme[property] = propertyOldvalue -- cgit v1.2.3