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/shared/misc/help.component.ts | 2 +- client/src/app/shared/misc/peertube-local-storage.ts | 6 +++--- client/src/app/shared/misc/utils.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared/misc') diff --git a/client/src/app/shared/misc/help.component.ts b/client/src/app/shared/misc/help.component.ts index ba0452e77..ccce1ccfa 100644 --- a/client/src/app/shared/misc/help.component.ts +++ b/client/src/app/shared/misc/help.component.ts @@ -60,7 +60,7 @@ export class HelpComponent implements OnInit, OnChanges { } private createMarkdownList (rules: string[]) { - const rulesToText = { + const rulesToText: any = { 'emphasis': this.i18n('Emphasis'), 'link': this.i18n('Links'), 'newline': this.i18n('New lines'), diff --git a/client/src/app/shared/misc/peertube-local-storage.ts b/client/src/app/shared/misc/peertube-local-storage.ts index 260f994b6..fb5c45acf 100644 --- a/client/src/app/shared/misc/peertube-local-storage.ts +++ b/client/src/app/shared/misc/peertube-local-storage.ts @@ -6,7 +6,7 @@ class MemoryStorage { [key: string]: any [index: number]: string - getItem (key) { + getItem (key: any) { const stringKey = String(key) if (valuesMap.has(key)) { return String(valuesMap.get(stringKey)) @@ -15,11 +15,11 @@ class MemoryStorage { return null } - setItem (key, val) { + setItem (key: any, val: any) { valuesMap.set(String(key), String(val)) } - removeItem (key) { + removeItem (key: any) { valuesMap.delete(key) } diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/shared/misc/utils.ts index c8b7ebc67..78be2e5dd 100644 --- a/client/src/app/shared/misc/utils.ts +++ b/client/src/app/shared/misc/utils.ts @@ -102,7 +102,7 @@ function objectToFormData (obj: any, form?: FormData, namespace?: string) { return fd } -function lineFeedToHtml (obj: object, keyToNormalize: string) { +function lineFeedToHtml (obj: any, keyToNormalize: string) { return immutableAssign(obj, { [keyToNormalize]: obj[keyToNormalize].replace(/\r?\n|\r/g, '
') }) -- cgit v1.2.3