diff options
author | bobzel <zzzman@gmail.com> | 2024-09-17 21:54:47 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-09-17 21:54:47 -0400 |
commit | 31321f6def982305ea89cdfe5a873b942060eb84 (patch) | |
tree | e3923478e97b688bde7d413c4038c20192877203 /src/client/views/global/globalScripts.ts | |
parent | 78f348cd1406cfaf3d0247973b826783ab3532b5 (diff) | |
parent | 921ab051bfcaa805cb18f40dfcd189624d83f43a (diff) |
fixed eslint started some linting
Diffstat (limited to 'src/client/views/global/globalScripts.ts')
-rw-r--r-- | src/client/views/global/globalScripts.ts | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/client/views/global/globalScripts.ts b/src/client/views/global/globalScripts.ts index 6ccbf28f8..2047d658f 100644 --- a/src/client/views/global/globalScripts.ts +++ b/src/client/views/global/globalScripts.ts @@ -138,8 +138,8 @@ ScriptingGlobals.add(function toggleOverlay(checkResult?: boolean) { ScriptingGlobals.add(function showFreeform(attr: 'hcenter' | 'vcenter' | 'grid' | 'snaplines' | 'clusters' | 'viewAll' | 'fitOnce', checkResult?: boolean, persist?: boolean) { const selected = DocumentView.SelectedDocs().lastElement(); - function isAttrFiltered(attr: string) { - return StrListCast(selected._childFilters).some(filter => filter.includes(attr)); + function isAttrFiltered(attribute: string) { + return StrListCast(selected._childFilters).some(filter => filter.includes(attribute)); } // prettier-ignore @@ -180,23 +180,23 @@ ScriptingGlobals.add(function showFreeform(attr: 'hcenter' | 'vcenter' | 'grid' }], ['flashcards', { checkResult: (doc: Doc) => BoolCast(Doc.UserDoc().defaultToFlashcards, false), - setDoc: (doc: Doc, dv: DocumentView) => Doc.UserDoc().defaultToFlashcards = !Doc.UserDoc().defaultToFlashcards, + setDoc: (doc: Doc, dv: DocumentView) => { Doc.UserDoc().defaultToFlashcards = !Doc.UserDoc().defaultToFlashcards}, // prettier-ignore }], ['time', { checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "time", - setDoc: (doc: Doc, dv: DocumentView) => doc.cardSort === "time" ? doc.cardSort = '' : doc.cardSort = 'time', + setDoc: (doc: Doc, dv: DocumentView) => { doc.cardSort === "time" ? doc.cardSort = '' : doc.cardSort = 'time'}, // prettier-ignore }], ['docType', { checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "type", - setDoc: (doc: Doc, dv: DocumentView) => doc.cardSort === "type" ? doc.cardSort = '' : doc.cardSort = 'type', + setDoc: (doc: Doc, dv: DocumentView) => { doc.cardSort === "type" ? doc.cardSort = '' : doc.cardSort = 'type'}, // prettier-ignore }], ['color', { checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "color", - setDoc: (doc: Doc, dv: DocumentView) => doc.cardSort === "color" ? doc.cardSort = '' : doc.cardSort = 'color', + setDoc: (doc: Doc, dv: DocumentView) => { doc.cardSort === "color" ? doc.cardSort = '' : doc.cardSort = 'color'}, // prettier-ignore }], ['tag', { checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "tag", - setDoc: (doc: Doc, dv: DocumentView) => doc.cardSort === "tag" ? doc.cardSort = '' : doc.cardSort = 'tag', + setDoc: (doc: Doc, dv: DocumentView) => { doc.cardSort === "tag" ? doc.cardSort = '' : doc.cardSort = 'tag'}, // prettier-ignore }], ['up', { checkResult: (doc: Doc) => BoolCast(!doc?.cardSort_isDesc), @@ -239,7 +239,7 @@ ScriptingGlobals.add(function showFreeform(attr: 'hcenter' | 'vcenter' | 'grid' }); - const iconMap: { [key: number]: any } = { + const iconMap: { [key: number]: string } = { 0: 'star', 1: 'heart', 2: 'cloud', @@ -272,7 +272,8 @@ ScriptingGlobals.add(function showFreeform(attr: 'hcenter' | 'vcenter' | 'grid' /** * Applies a filter to the selected document (or, if the settins button is pressed, opens the filter panel) */ -ScriptingGlobals.add(function handleTags(value?: any, checkResult?: boolean) { +// eslint-disable-next-line prefer-arrow-callback +ScriptingGlobals.add(function handleTags(value: string, checkResult?: boolean) { const selected = DocumentView.SelectedDocs().lastElement(); function isAttrFiltered(attr: string) { @@ -489,6 +490,7 @@ function setActiveTool(tool: InkTool | Gestures, keepPrim: boolean, checkResult? ScriptingGlobals.add(setActiveTool, 'sets the active ink tool mode'); +// eslint-disable-next-line prefer-arrow-callback ScriptingGlobals.add(function activeEraserTool() { return StrCast(Doc.UserDoc().activeEraserTool, InkTool.StrokeEraser); }, 'returns the current eraser tool'); |