From fb9d8bf9472ee2b6665179d8548de74e7da769c4 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 6 Jan 2022 03:04:01 +0100 Subject: [PATCH] Fix TSLint nits --- app/javascript/retrospring/features/settings/crop.ts | 4 ++-- app/javascript/retrospring/features/settings/mute.ts | 2 +- app/javascript/retrospring/features/settings/theme.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/javascript/retrospring/features/settings/crop.ts b/app/javascript/retrospring/features/settings/crop.ts index e7e201d2..13e09c77 100644 --- a/app/javascript/retrospring/features/settings/crop.ts +++ b/app/javascript/retrospring/features/settings/crop.ts @@ -3,7 +3,7 @@ import Croppr from 'croppr'; const readImage = (file, callback) => callback((window.URL || window.webkitURL).createObjectURL(file)); -export function profilePictureChangeHandler(event: Event) { +export function profilePictureChangeHandler(event: Event): void { const input = event.target as HTMLInputElement; const cropControls = document.querySelector('#profile-picture-crop-controls'); @@ -32,7 +32,7 @@ export function profilePictureChangeHandler(event: Event) { } } -export function profileHeaderChangeHandler(event: Event) { +export function profileHeaderChangeHandler(event: Event): void { const input = event.target as HTMLInputElement; const cropControls = document.querySelector('#profile-header-crop-controls'); diff --git a/app/javascript/retrospring/features/settings/mute.ts b/app/javascript/retrospring/features/settings/mute.ts index 961cee0c..e8580f8c 100644 --- a/app/javascript/retrospring/features/settings/mute.ts +++ b/app/javascript/retrospring/features/settings/mute.ts @@ -58,7 +58,7 @@ function createDeleteEvent( } } -export function muteDocumentHandler() { +export function muteDocumentHandler(): void { const submit: HTMLButtonElement = document.getElementById('new-rule-submit') as HTMLButtonElement; if (!submit || submit.classList.contains('js-initialized')) return; diff --git a/app/javascript/retrospring/features/settings/theme.ts b/app/javascript/retrospring/features/settings/theme.ts index c4cf02ff..d7d340c8 100644 --- a/app/javascript/retrospring/features/settings/theme.ts +++ b/app/javascript/retrospring/features/settings/theme.ts @@ -15,7 +15,7 @@ const previewTheme = (): void => { generateTheme(payload); } -const generateTheme = (payload: object): void => { +const generateTheme = (payload: Record): void => { const themeAttributeMap = { 'primary_color': 'primary', 'primary_text': 'primary-text', @@ -88,7 +88,7 @@ export function themeDocumentHandler(): void { color.addEventListener('input', () => { clearTimeout(previewTimeout); - setTimeout(previewTheme, 1000); + previewTimeout = setTimeout(previewTheme, 1000); }); }); }