From efa676b9214b0caca80ae11b977331c1fa2d7468 Mon Sep 17 00:00:00 2001 From: Xmader Date: Sun, 27 Sep 2020 11:45:51 -0400 Subject: [PATCH] style: lint --- src/main.ts | 2 +- src/pdf.ts | 2 +- src/recaptcha.ts | 2 +- src/scoreinfo.ts | 1 + src/worker-helper.ts | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 0dffe47..ecd3ec3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -78,7 +78,7 @@ const main = (): void => { // parse mscz data const data = new Uint8Array( - new Uint8Array(await fetchMscz()) // copy its ArrayBuffer + new Uint8Array(await fetchMscz()), // copy its ArrayBuffer ) score = await w['WebMscore'].load('mscz', data) await score.generateExcerpts() diff --git a/src/pdf.ts b/src/pdf.ts index 9d4fa16..c739ceb 100644 --- a/src/pdf.ts +++ b/src/pdf.ts @@ -5,7 +5,7 @@ import scoreinfo from './scoreinfo' let pdfBlob: Blob -const _downloadPDF = async (imgURLs: string[], imgType: 'svg' | 'png', name?: string): Promise => { +const _downloadPDF = async (imgURLs: string[], imgType: 'svg' | 'png', name = ''): Promise => { if (pdfBlob) { return saveAs(pdfBlob, `${name}.pdf`) } diff --git a/src/recaptcha.ts b/src/recaptcha.ts index fdcb063..f7e7446 100644 --- a/src/recaptcha.ts +++ b/src/recaptcha.ts @@ -6,7 +6,7 @@ const SITE_KEY = '6Ldxtt8UAAAAALvcRqWTlVOVIB7MmEWwN-zw_9fM' type token = string; interface GRecaptcha { - ready (cb: Function): void; + ready (cb: () => any): void; execute (siteKey: string, opts: { action: string }): Promise; } diff --git a/src/scoreinfo.ts b/src/scoreinfo.ts index b859fab..118d7cb 100644 --- a/src/scoreinfo.ts +++ b/src/scoreinfo.ts @@ -5,6 +5,7 @@ const scoreinfo = { get playerdata (): ScorePlayerData { // @ts-ignore + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return window.UGAPP.store.jmuse_settings.score_player }, diff --git a/src/worker-helper.ts b/src/worker-helper.ts index bd9e620..e4d623d 100644 --- a/src/worker-helper.ts +++ b/src/worker-helper.ts @@ -2,7 +2,7 @@ import { PDFWorkerMessage } from './worker' import { PDFWorker } from '../dist/cache/worker' -const scriptUrlFromFunction = (fn: Function): string => { +const scriptUrlFromFunction = (fn: () => any): string => { const blob = new Blob(['(' + fn.toString() + ')()'], { type: 'application/javascript' }) return URL.createObjectURL(blob) }