From 9df52d660feb722404be00a50f3c8a612bec1c15 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Aug 2021 14:42:53 +0200 Subject: Migrate client to eslint --- client/src/root-helpers/bytes.ts | 2 +- client/src/root-helpers/peertube-web-storage.ts | 4 ++-- client/src/root-helpers/plugins-manager.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'client/src/root-helpers') diff --git a/client/src/root-helpers/bytes.ts b/client/src/root-helpers/bytes.ts index ec8b55faa..bda786cc6 100644 --- a/client/src/root-helpers/bytes.ts +++ b/client/src/root-helpers/bytes.ts @@ -1,4 +1,4 @@ -const dictionary: Array<{ max: number; type: string }> = [ +const dictionary: Array<{ max: number, type: string }> = [ { max: 1024, type: 'B' }, { max: 1048576, type: 'KB' }, { max: 1073741824, type: 'MB' }, diff --git a/client/src/root-helpers/peertube-web-storage.ts b/client/src/root-helpers/peertube-web-storage.ts index d4cad8a20..68a2462de 100644 --- a/client/src/root-helpers/peertube-web-storage.ts +++ b/client/src/root-helpers/peertube-web-storage.ts @@ -5,7 +5,7 @@ const valuesMap = new Map() function proxify (instance: MemoryStorage) { return new Proxy(instance, { set: function (obj, prop: string | symbol, value) { - if (MemoryStorage.prototype.hasOwnProperty(prop)) { + if (Object.prototype.hasOwnProperty.call(MemoryStorage, prop)) { // FIXME: symbol typing issue https://github.com/microsoft/TypeScript/issues/1863 instance[prop as any] = value } else { @@ -14,7 +14,7 @@ function proxify (instance: MemoryStorage) { return true }, get: function (target, name: string | symbol | number) { - if (MemoryStorage.prototype.hasOwnProperty(name)) { + if (Object.prototype.hasOwnProperty.call(MemoryStorage, name)) { // FIXME: symbol typing issue https://github.com/microsoft/TypeScript/issues/1863 return instance[name as any] } diff --git a/client/src/root-helpers/plugins-manager.ts b/client/src/root-helpers/plugins-manager.ts index d14ac4acd..f1687d91d 100644 --- a/client/src/root-helpers/plugins-manager.ts +++ b/client/src/root-helpers/plugins-manager.ts @@ -155,7 +155,7 @@ class PluginsManager { try { if (!isReload) this.loadedScopes.push(scope) - const toLoad = this.scopes[ scope ] + const toLoad = this.scopes[scope] if (!Array.isArray(toLoad)) { this.loadingScopes[scope] = false this.pluginsLoaded[scope].next(true) @@ -168,11 +168,11 @@ class PluginsManager { for (const pluginInfo of toLoad) { const clientScript = pluginInfo.clientScript - if (this.loadedScripts[ clientScript.script ]) continue + if (this.loadedScripts[clientScript.script]) continue promises.push(this.loadPlugin(pluginInfo)) - this.loadedScripts[ clientScript.script ] = true + this.loadedScripts[clientScript.script] = true } await Promise.all(promises) -- cgit v1.2.3