fix frontend lint errors
This commit is contained in:
parent
33b9f998da
commit
74d301dcf1
13 changed files with 54 additions and 41 deletions
|
|
@ -43,11 +43,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, isRef, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, ref, useTemplateRef, watch, type Ref } from 'vue';
|
||||
import { computed, isRef, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, ref, useTemplateRef, watch } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { useDocumentVisibility } from '@@/js/use-document-visibility.js';
|
||||
import { onScrollTop, isHeadVisible, getBodyScrollHeight, getScrollContainer, onScrollBottom, scrollToBottom, scrollInContainer, isTailVisible } from '@@/js/scroll.js';
|
||||
import type { ComputedRef } from 'vue';
|
||||
import type { ComputedRef, Ref } from 'vue';
|
||||
import type { MisskeyEntity } from '@/types/date-separated-list.js';
|
||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
|
@ -197,10 +197,10 @@ watch(error, (n, o) => {
|
|||
emit('status', n);
|
||||
});
|
||||
|
||||
function getActualValue<T>(input: T|Ref<T>|undefined, defaultValue: T) : T {
|
||||
if (!input) return defaultValue;
|
||||
if (isRef(input)) return input.value;
|
||||
return input;
|
||||
function getActualValue<T>(input: T | Ref<T> | undefined, defaultValue: T) : T {
|
||||
if (!input) return defaultValue;
|
||||
if (isRef(input)) return input.value;
|
||||
return input;
|
||||
}
|
||||
|
||||
async function init(): Promise<void> {
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ const domain = computed(() => new URL(props.url).hostname);
|
|||
// overload function を使いたいので lint エラーを無視する
|
||||
function done(canceled: true): void;
|
||||
function done(canceled: false, result: Result): void; // eslint-disable-line no-redeclare
|
||||
|
||||
function done(canceled: boolean, result?: Result): void { // eslint-disable-line no-redeclare
|
||||
emit('done', { canceled, result } as { canceled: true } | { canceled: false, result: Result });
|
||||
modal.value?.close();
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
import { ref, onDeactivated } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import type { PublicAPI, PublicAPILike } from '@/types/ruffle/setup';
|
||||
import type { PlayerElement } from '@/types/ruffle/player.js';
|
||||
import type { PlayerElement } from '@/types/ruffle/player';
|
||||
import MkEllipsis from '@/components/global/MkEllipsis.vue';
|
||||
import MkLoading from '@/components/global/MkLoading.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
|
@ -177,11 +177,11 @@ async function loadContent() {
|
|||
loadingStatus.value = undefined;
|
||||
} catch (error) {
|
||||
try {
|
||||
await fetch('https://raw.esm.sh/', {
|
||||
await window.fetch('https://raw.esm.sh/', {
|
||||
mode: 'cors',
|
||||
});
|
||||
handleError(error); // Unexpected error
|
||||
} catch (_) {
|
||||
} catch {
|
||||
// Must be CSP because esm.sh should be online if `loadRuffle()` didn't fail
|
||||
handleError(i18n.ts._flash.cspError);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, type CSSProperties } from 'vue';
|
||||
import { instanceName as localInstanceName } from '@@/js/config.js';
|
||||
import { computed } from 'vue';
|
||||
import type { CSSProperties } from 'vue';
|
||||
import { instance as localInstance } from '@/instance.js';
|
||||
import { getProxiedImageUrlNullable } from '@/utility/media-proxy.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ let mousePosY = 0;
|
|||
|
||||
let frameCount = 0;
|
||||
let idleTime = 0;
|
||||
let idleAnimation: string|null = null;
|
||||
let idleAnimation: string | null = null;
|
||||
let idleAnimationFrame = 0;
|
||||
let lastFrameTimestamp;
|
||||
|
||||
|
|
@ -97,7 +97,8 @@ function init() {
|
|||
nekoEl.value.style.left = `${nekoPosX - 16}px`;
|
||||
nekoEl.value.style.top = `${nekoPosY - 16}px`;
|
||||
|
||||
document.addEventListener('mousemove', (event) => {
|
||||
// TODO this causes a memory leak because it never gets unbound
|
||||
window.document.addEventListener('mousemove', (event) => {
|
||||
mousePosX = event.clientX;
|
||||
mousePosY = event.clientY;
|
||||
});
|
||||
|
|
@ -140,7 +141,6 @@ function idle() {
|
|||
if (
|
||||
idleTime > 10 &&
|
||||
Math.floor(Math.random() * 200) === 0 &&
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
idleAnimation == null
|
||||
) {
|
||||
let avalibleIdleAnimations = ['sleeping', 'scratchSelf'];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue