From 9f9c456433c375e5548a780e66a9c8ff2ecbd612 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:41:23 +1100 Subject: [PATCH] Enable no-unnecessary-type-assertion ts eslint rule --- eslint.config.mjs | 1 + src/components/documentManager.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 20a351d..00573df 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -59,6 +59,7 @@ export default [ rules: { '@typescript-eslint/explicit-function-return-type': 'error', '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/no-unused-expressions': 'warn', '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/prefer-ts-expect-error': 'error', diff --git a/src/components/documentManager.ts b/src/components/documentManager.ts index 32f3ed8..f3df9d6 100644 --- a/src/components/documentManager.ts +++ b/src/components/documentManager.ts @@ -581,9 +581,9 @@ export abstract class DocumentManager { const element = this.querySelector('.detailImageProgressContainer'); if (value) { - (element as HTMLElement).classList.remove('d-none'); + element.classList.remove('d-none'); } else { - (element as HTMLElement).classList.add('d-none'); + element.classList.add('d-none'); } }