From 13278a5cf67de69678d8c4c5fb97e6eb00c94c11 Mon Sep 17 00:00:00 2001 From: James Maa Date: Thu, 9 May 2024 15:42:35 +0800 Subject: Update eslint unsafe rule (#887) * Enable @typescript-eslint/no-unsafe-assignment * Updates * Add missing import * Updates * Fix types? * Fix tests * Address comments * Move TextProcessorVariant to types * Update types/ext/translation-internal.d.ts Co-authored-by: StefanVukovic99 Signed-off-by: James Maa --------- Signed-off-by: James Maa Co-authored-by: toasted-nutbread Co-authored-by: StefanVukovic99 --- ext/js/display/display-history.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/js/display') diff --git a/ext/js/display/display-history.js b/ext/js/display/display-history.js index 183368d0..0806e17b 100644 --- a/ext/js/display/display-history.js +++ b/ext/js/display/display-history.js @@ -37,6 +37,7 @@ export class DisplayHistory extends EventDispatcher { /** @type {Map} */ this._historyMap = new Map(); + /** @type {unknown} */ const historyState = history.state; const {id, state} = ( isObjectNotArray(historyState) ? @@ -188,6 +189,7 @@ export class DisplayHistory extends EventDispatcher { /** */ _updateStateFromHistory() { + /** @type {unknown} */ let state = history.state; let id = null; if (isObjectNotArray(state)) { @@ -208,7 +210,7 @@ export class DisplayHistory extends EventDispatcher { // Fallback this._current.id = (typeof id === 'string' ? id : this._generateId()); - this._current.state = state; + this._current.state = /** @type {import('display-history').EntryState} */ (state); this._current.content = null; this._clear(); } -- cgit v1.2.3