diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-19 07:30:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 12:30:17 +0000 |
commit | 2da866f982930c76d2317a3be426410683ecf5a2 (patch) | |
tree | e77ce545177ba398068cb63037096a56dea04e2c /ext/js/display | |
parent | 65fa65fc7765bc9a6557d3ce6f8bdcef5b5e0cf7 (diff) |
Update eslint rules (#710)
Diffstat (limited to 'ext/js/display')
-rw-r--r-- | ext/js/display/display-anki.js | 14 | ||||
-rw-r--r-- | ext/js/display/display-audio.js | 10 | ||||
-rw-r--r-- | ext/js/display/display-content-manager.js | 4 | ||||
-rw-r--r-- | ext/js/display/display-profile-selection.js | 6 | ||||
-rw-r--r-- | ext/js/display/display-resizer.js | 8 | ||||
-rw-r--r-- | ext/js/display/display.js | 16 | ||||
-rw-r--r-- | ext/js/display/option-toggle-hotkey-handler.js | 2 | ||||
-rw-r--r-- | ext/js/display/popup-main.js | 2 | ||||
-rw-r--r-- | ext/js/display/query-parser.js | 4 | ||||
-rw-r--r-- | ext/js/display/search-display-controller.js | 6 |
10 files changed, 36 insertions, 36 deletions
diff --git a/ext/js/display/display-anki.js b/ext/js/display/display-anki.js index 03daf003..fb7bd85f 100644 --- a/ext/js/display/display-anki.js +++ b/ext/js/display/display-anki.js @@ -223,7 +223,7 @@ export class DisplayAnki { this._modeOptions.set('term-kanji', terms); this._modeOptions.set('term-kana', terms); - this._updateAnkiFieldTemplates(options); + void this._updateAnkiFieldTemplates(options); } /** */ @@ -258,7 +258,7 @@ export class DisplayAnki { /** */ _onContentUpdateComplete() { - this._updateDictionaryEntryDetails(); + void this._updateDictionaryEntryDetails(); } /** @@ -277,7 +277,7 @@ export class DisplayAnki { const mode = this._getValidCreateMode(element.dataset.mode); if (mode === null) { return; } const index = this._display.getElementDictionaryEntryIndex(element); - this._addAnkiNote(index, mode); + void this._addAnkiNote(index, mode); } /** @@ -444,7 +444,7 @@ export class DisplayAnki { */ _tryAddAnkiNoteForSelectedEntry(mode) { const index = this._display.selectedIndex; - this._addAnkiNote(index, mode); + void this._addAnkiNote(index, mode); } /** @@ -783,7 +783,7 @@ export class DisplayAnki { if (e.shiftKey) { this._showViewNotesMenu(element); } else { - this._viewNotes(element); + void this._viewNotes(element); } } @@ -804,7 +804,7 @@ export class DisplayAnki { switch (action) { case 'viewNotes': if (item !== null) { - this._viewNotes(item); + void this._viewNotes(item); } break; } @@ -927,7 +927,7 @@ export class DisplayAnki { const index = this._display.selectedIndex; const button = this._getViewNoteButton(index); if (button !== null) { - this._viewNotes(button); + void this._viewNotes(button); } } diff --git a/ext/js/display/display-audio.js b/ext/js/display/display-audio.js index 5f4131d0..d19a448c 100644 --- a/ext/js/display/display-audio.js +++ b/ext/js/display/display-audio.js @@ -225,7 +225,7 @@ export class DisplayAudio { const callback = () => { this._autoPlayAudioTimer = null; - this.playAudio(0, 0); + void this.playAudio(0, 0); }; if (this._autoPlayAudioDelay > 0) { @@ -248,7 +248,7 @@ export class DisplayAudio { /** */ _onHotkeyActionPlayAudio() { - this.playAudio(this._display.selectedIndex, 0); + void this.playAudio(this._display.selectedIndex, 0); } /** @@ -256,7 +256,7 @@ export class DisplayAudio { */ _onHotkeyActionPlayAudioFromSource(source) { if (!(typeof source === 'string' || typeof source === 'undefined' || source === null)) { return; } - this.playAudio(this._display.selectedIndex, 0, source); + void this.playAudio(this._display.selectedIndex, 0, source); } /** @type {import('display').DirectApiHandler<'displayAudioClearAutoPlayTimer'>} */ @@ -317,7 +317,7 @@ export class DisplayAudio { if (e.shiftKey) { this._showAudioMenu(button, dictionaryEntryIndex, headwordIndex); } else { - this.playAudio(dictionaryEntryIndex, headwordIndex); + void this.playAudio(dictionaryEntryIndex, headwordIndex); } } @@ -348,7 +348,7 @@ export class DisplayAudio { if (shiftKey) { e.preventDefault(); } - this._playAudioFromSource(dictionaryEntryIndex, headwordIndex, item); + void this._playAudioFromSource(dictionaryEntryIndex, headwordIndex, item); break; case 'setPrimaryAudio': e.preventDefault(); diff --git a/ext/js/display/display-content-manager.js b/ext/js/display/display-content-manager.js index 81742279..c61c3aca 100644 --- a/ext/js/display/display-content-manager.js +++ b/ext/js/display/display-content-manager.js @@ -49,7 +49,7 @@ export class DisplayContentManager { * @param {import('display-content-manager').OnUnloadCallback} onUnload The callback that is executed when the media should be unloaded. */ loadMedia(path, dictionary, onLoad, onUnload) { - this._loadMedia(path, dictionary, onLoad, onUnload); + void this._loadMedia(path, dictionary, onLoad, onUnload); } /** @@ -65,7 +65,7 @@ export class DisplayContentManager { for (const map of this._mediaCache.values()) { for (const result of map.values()) { - this._revokeUrl(result); + void this._revokeUrl(result); } } this._mediaCache.clear(); diff --git a/ext/js/display/display-profile-selection.js b/ext/js/display/display-profile-selection.js index 3df79b74..0aa08b00 100644 --- a/ext/js/display/display-profile-selection.js +++ b/ext/js/display/display-profile-selection.js @@ -63,7 +63,7 @@ export class DisplayProfileSelection { if (source === this._source) { return; } this._profileListNeedsUpdate = true; if (this._profilePanel.isVisible()) { - this._updateProfileList(); + void this._updateProfileList(); } } @@ -84,7 +84,7 @@ export class DisplayProfileSelection { this._profileButton.classList.toggle('sidebar-button-highlight', visible); document.documentElement.dataset.profilePanelVisible = `${visible}`; if (visible && this._profileListNeedsUpdate) { - this._updateProfileList(); + void this._updateProfileList(); } } @@ -121,7 +121,7 @@ export class DisplayProfileSelection { _onProfileRadioChange(index, e) { const element = /** @type {HTMLInputElement} */ (e.currentTarget); if (element.checked) { - this._setProfileCurrent(index); + void this._setProfileCurrent(index); } } diff --git a/ext/js/display/display-resizer.js b/ext/js/display/display-resizer.js index 7e346c7d..48117155 100644 --- a/ext/js/display/display-resizer.js +++ b/ext/js/display/display-resizer.js @@ -87,7 +87,7 @@ export class DisplayResizer { } else { if (this._startSize === null) { return; } const {clientX: x, clientY: y} = e; - this._updateFrameSize(x, y); + void this._updateFrameSize(x, y); } } @@ -115,7 +115,7 @@ export class DisplayResizer { const primaryTouch = this._getTouch(e.changedTouches, this._touchIdentifier); if (primaryTouch === null) { return; } const {clientX: x, clientY: y} = primaryTouch; - this._updateFrameSize(x, y); + void this._updateFrameSize(x, y); } /** @@ -138,7 +138,7 @@ export class DisplayResizer { documentElement.dataset.isResizing = 'true'; } - this._initializeFrameResize(token); + void this._initializeFrameResize(token); } /** @@ -163,7 +163,7 @@ export class DisplayResizer { documentElement.dataset.isResizing = 'true'; } - this._initializeFrameResize(token); + void this._initializeFrameResize(token); } /** diff --git a/ext/js/display/display.js b/ext/js/display/display.js index 588508b5..d0edd0bd 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -364,7 +364,7 @@ export class Display extends EventDispatcher { /** */ initializeState() { - this._onStateChanged(); + void this._onStateChanged(); if (this._frameEndpoint !== null) { this._frameEndpoint.signal(); } @@ -448,7 +448,7 @@ export class Display extends EventDispatcher { } }); - this._updateNestedFrontend(options); + void this._updateNestedFrontend(options); this._updateContentTextScanner(options); this.trigger('optionsUpdated', {options}); @@ -523,10 +523,10 @@ export class Display extends EventDispatcher { close() { switch (this._pageType) { case 'popup': - this.invokeContentOrigin('frontendClosePopup', void 0); + void this.invokeContentOrigin('frontendClosePopup', void 0); break; case 'search': - this._closeTab(); + void this._closeTab(); break; } } @@ -964,7 +964,7 @@ export class Display extends EventDispatcher { _onDebugLogClick(e) { const link = /** @type {HTMLElement} */ (e.currentTarget); const index = this.getElementDictionaryEntryIndex(link); - this._logDictionaryEntryData(index); + void this._logDictionaryEntryData(index); } /** @@ -1064,7 +1064,7 @@ export class Display extends EventDispatcher { const {action} = e.detail; switch (action) { case 'log-debug-info': - this._logDictionaryEntryData(this.getElementDictionaryEntryIndex(node)); + void this._logDictionaryEntryData(this.getElementDictionaryEntryIndex(node)); break; } } @@ -1345,7 +1345,7 @@ export class Display extends EventDispatcher { const visible = this._isQueryParserVisible(); this._queryParserContainer.hidden = !visible || text.length === 0; if (visible && this._queryParser.text !== text) { - this._setQueryParserText(text); + void this._setQueryParserText(text); } } @@ -1738,7 +1738,7 @@ export class Display extends EventDispatcher { if (typeof this._contentOriginFrameId !== 'number') { return false; } const selection = window.getSelection(); if (selection !== null && selection.toString().length > 0) { return false; } - this._copyHostSelectionSafe(); + void this._copyHostSelectionSafe(); return true; } diff --git a/ext/js/display/option-toggle-hotkey-handler.js b/ext/js/display/option-toggle-hotkey-handler.js index b2f48a3e..cf2d31e4 100644 --- a/ext/js/display/option-toggle-hotkey-handler.js +++ b/ext/js/display/option-toggle-hotkey-handler.js @@ -60,7 +60,7 @@ export class OptionToggleHotkeyHandler { */ _onHotkeyActionToggleOption(argument) { if (typeof argument !== 'string') { return; } - this._toggleOption(argument); + void this._toggleOption(argument); } /** diff --git a/ext/js/display/popup-main.js b/ext/js/display/popup-main.js index fe1d20dd..b37a1ca4 100644 --- a/ext/js/display/popup-main.js +++ b/ext/js/display/popup-main.js @@ -42,7 +42,7 @@ await Application.main(true, async (application) => { displayAnki.prepare(); const displayProfileSelection = new DisplayProfileSelection(display); - displayProfileSelection.prepare(); + void displayProfileSelection.prepare(); const displayResizer = new DisplayResizer(display); displayResizer.prepare(); diff --git a/ext/js/display/query-parser.js b/ext/js/display/query-parser.js index edae96fb..875d9d5a 100644 --- a/ext/js/display/query-parser.js +++ b/ext/js/display/query-parser.js @@ -207,7 +207,7 @@ export class QueryParser extends EventDispatcher { scope: 'profile', optionsContext }; - this._api.modifySettings([modification], 'search'); + void this._api.modifySettings([modification], 'search'); } /** @@ -410,6 +410,6 @@ export class QueryParser extends EventDispatcher { _loadJapaneseWanakanaModule() { if (this._japaneseWanakanaModuleImport !== null) { return; } this._japaneseWanakanaModuleImport = import('../language/ja/japanese-wanakana.js'); - this._japaneseWanakanaModuleImport.then((value) => { this._japaneseWanakanaModule = value; }); + void this._japaneseWanakanaModuleImport.then((value) => { this._japaneseWanakanaModule = value; }); } } diff --git a/ext/js/display/search-display-controller.js b/ext/js/display/search-display-controller.js index 23824aed..d8126027 100644 --- a/ext/js/display/search-display-controller.js +++ b/ext/js/display/search-display-controller.js @@ -298,7 +298,7 @@ export class SearchDisplayController { scope: 'profile', optionsContext: this._display.getOptionsContext() }; - this._display.application.api.modifySettings([modification], 'search'); + void this._display.application.api.modifySettings([modification], 'search'); } /** @@ -307,7 +307,7 @@ export class SearchDisplayController { _onClipboardMonitorEnableChange(e) { const element = /** @type {HTMLInputElement} */ (e.target); const enabled = element.checked; - this._setClipboardMonitorEnabled(enabled); + void this._setClipboardMonitorEnabled(enabled); } /** */ @@ -323,7 +323,7 @@ export class SearchDisplayController { const value = Number.parseInt(node.value, 10); const optionsFull = await this._display.application.api.optionsGetFull(); if (typeof value === 'number' && Number.isFinite(value) && value >= 0 && value <= optionsFull.profiles.length) { - this._setPrimaryProfileIndex(value); + await this._setPrimaryProfileIndex(value); } } |