From 5b0afc9a9849cd0d8ec2b8bcfa789ddf5eeb8de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Sun, 14 Jan 2024 02:46:58 +0900 Subject: [PATCH] fix code quality issues --- .../src/components/global/MkMisskeyFlavoredMarkdown.ts | 8 ++++---- packages/frontend/src/pages/drop-and-fusion.game.vue | 8 ++++---- packages/frontend/src/scripts/drop-and-fusion-engine.ts | 2 +- scripts/changelog-checker/src/index.ts | 1 - 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts index f55069200..794ebd1c4 100644 --- a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts +++ b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts @@ -59,14 +59,14 @@ export default function(props: MfmProps, context: SetupContext) { const validTime = (t: string | null | undefined) => { if (t == null) return null; - return t.match(/^[0-9.]+s$/) ? t : null; + return RegExp(/^[0-9.]+s$/).exec(t) ? t : null; }; - + const validColor = (c: string | null | undefined): string | null => { if (c == null) return null; - return c.match(/^[0-9a-f]{3,6}$/i) ? c : null; + return RegExp(/^[0-9a-f]{3,6}$/i).exec(c) ? c : null; }; - + const useAnim = defaultStore.state.advancedMfm && defaultStore.state.animatedMfm; /** diff --git a/packages/frontend/src/pages/drop-and-fusion.game.vue b/packages/frontend/src/pages/drop-and-fusion.game.vue index f14f5dbff..05c462d8b 100644 --- a/packages/frontend/src/pages/drop-and-fusion.game.vue +++ b/packages/frontend/src/pages/drop-and-fusion.game.vue @@ -1003,10 +1003,10 @@ function attachGameEvents() { }); } } - } else { - if (!props.mute) { - // TODO: 融合後のモノがない場合でも何らかの効果音を再生 - } + //} else { + // if (!props.mute) { + // // TODO: 融合後のモノがない場合でも何らかの効果音を再生 + // } } }); diff --git a/packages/frontend/src/scripts/drop-and-fusion-engine.ts b/packages/frontend/src/scripts/drop-and-fusion-engine.ts index 06668743e..0bd04552c 100644 --- a/packages/frontend/src/scripts/drop-and-fusion-engine.ts +++ b/packages/frontend/src/scripts/drop-and-fusion-engine.ts @@ -530,6 +530,7 @@ export class DropAndFusionGame extends EventEmitter<{ case 'yen': return YEN_MONOS; case 'square': return SQUARE_MONOS; case 'sweets': return SWEETS_MONOS; + default: throw new Error('unknown game mode'); } } @@ -743,7 +744,6 @@ export class DropAndFusionGame extends EventEmitter<{ this.gameOver(); break; } - continue; } } } diff --git a/scripts/changelog-checker/src/index.ts b/scripts/changelog-checker/src/index.ts index 8cbeb297d..b8d6b7bd8 100644 --- a/scripts/changelog-checker/src/index.ts +++ b/scripts/changelog-checker/src/index.ts @@ -26,7 +26,6 @@ function main() { if (!result.success) { abort(result.message); - return; } }