From d4381831209dfbbbddd6d238c68461c9601573e2 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 8 Feb 2024 06:52:06 -0500 Subject: Update eslint (#638) * Add json test * Update vscode settings to better handle json * Collapse eslint rules for easier readability * Reorganize * Update no-multi-spaces rule for JSON * Rules updates * Switch to @stylistic/eslint-plugin * Update deprecated stylistic rules * Group stylistic rules * Simplify rules * Move eslint env overrides to end of file * Add test * Move promiseAnimationFrame to separate file * Remove unneeded eslint disable * Remove unneeded --- ext/js/display/display-anki.js | 4 ++-- ext/js/display/display-audio.js | 4 ++-- ext/js/display/display.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'ext/js/display') diff --git a/ext/js/display/display-anki.js b/ext/js/display/display-anki.js index c19cfa22..665521dd 100644 --- a/ext/js/display/display-anki.js +++ b/ext/js/display/display-anki.js @@ -109,14 +109,14 @@ export class DisplayAnki { /** */ prepare() { this._noteContext = this._getNoteContext(); - /* eslint-disable no-multi-spaces */ + /* eslint-disable @stylistic/no-multi-spaces */ this._display.hotkeyHandler.registerActions([ ['addNoteKanji', () => { this._tryAddAnkiNoteForSelectedEntry('kanji'); }], ['addNoteTermKanji', () => { this._tryAddAnkiNoteForSelectedEntry('term-kanji'); }], ['addNoteTermKana', () => { this._tryAddAnkiNoteForSelectedEntry('term-kana'); }], ['viewNote', this._viewNoteForSelectedEntry.bind(this)] ]); - /* eslint-enable no-multi-spaces */ + /* eslint-enable @stylistic/no-multi-spaces */ this._display.on('optionsUpdated', this._onOptionsUpdated.bind(this)); this._display.on('contentClear', this._onContentClear.bind(this)); this._display.on('contentUpdateStart', this._onContentUpdateStart.bind(this)); diff --git a/ext/js/display/display-audio.js b/ext/js/display/display-audio.js index 4acd6494..deaa0976 100644 --- a/ext/js/display/display-audio.js +++ b/ext/js/display/display-audio.js @@ -82,7 +82,7 @@ export class DisplayAudio { /** */ prepare() { this._audioSystem.prepare(); - /* eslint-disable no-multi-spaces */ + /* eslint-disable @stylistic/no-multi-spaces */ this._display.hotkeyHandler.registerActions([ ['playAudio', this._onHotkeyActionPlayAudio.bind(this)], ['playAudioFromSource', this._onHotkeyActionPlayAudioFromSource.bind(this)] @@ -90,7 +90,7 @@ export class DisplayAudio { this._display.registerDirectMessageHandlers([ ['displayAudioClearAutoPlayTimer', this._onMessageClearAutoPlayTimer.bind(this)] ]); - /* eslint-enable no-multi-spaces */ + /* eslint-enable @stylistic/no-multi-spaces */ this._display.on('optionsUpdated', this._onOptionsUpdated.bind(this)); this._display.on('contentClear', this._onContentClear.bind(this)); this._display.on('contentUpdateEntry', this._onContentUpdateEntry.bind(this)); diff --git a/ext/js/display/display.js b/ext/js/display/display.js index 676f1a4f..f05feac8 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -200,7 +200,7 @@ export class Display extends EventDispatcher { /** @type {ThemeController} */ this._themeController = new ThemeController(document.documentElement); - /* eslint-disable no-multi-spaces */ + /* eslint-disable @stylistic/no-multi-spaces */ this._hotkeyHandler.registerActions([ ['close', () => { this._onHotkeyClose(); }], ['nextEntry', this._onHotkeyActionMoveRelative.bind(this, 1)], @@ -224,7 +224,7 @@ export class Display extends EventDispatcher { this.registerWindowMessageHandlers([ ['displayExtensionUnloaded', this._onMessageExtensionUnloaded.bind(this)] ]); - /* eslint-enable no-multi-spaces */ + /* eslint-enable @stylistic/no-multi-spaces */ } /** @type {import('../application.js').Application} */ -- cgit v1.2.3