From 47a10f6a6df1bfbb90af519e1b34996a328d28ca Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Thu, 30 Nov 2023 14:46:16 +0900 Subject: [PATCH] refactor(frontend): give local variable to explicit type annotation to avoid TS7043 (#12495) * refactor: give local variable to explicit type annotation to avoid TS7043 * chore: fix lint error --- .../src/components/global/MkMisskeyFlavoredMarkdown.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts index c5f247bce..d4c3ef60a 100644 --- a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts +++ b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts @@ -103,7 +103,7 @@ export default function(props: MfmProps) { case 'fn': { // TODO: CSSを文字列で組み立てていくと token.props.args.~~~ 経由でCSSインジェクションできるのでよしなにやる - let style; + let style: string | undefined; switch (token.props.name) { case 'tada': { const speed = validTime(token.props.args.speed) ?? '1s'; @@ -268,7 +268,7 @@ export default function(props: MfmProps) { ]); } } - if (style == null) { + if (style === undefined) { return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children, scale), ']']); } else { return h('span', {