chore: remove unused imports/variables

This commit is contained in:
naskya 2023-10-31 20:19:05 +09:00
parent 8845383fc2
commit 40d5ad1b2d
No known key found for this signature in database
GPG Key ID: 164DFF24E2D40139
55 changed files with 65 additions and 134 deletions

View File

@ -1,4 +1,4 @@
import { defineAsyncComponent, reactive } from "vue";
import { defineAsyncComponent } from "vue";
import type * as firefish from "firefish-js";
import { i18n } from "./i18n";
import { del, get, set } from "@/scripts/idb-proxy";

View File

@ -64,7 +64,6 @@ import { i18n } from "@/i18n";
import type { PageMetadata } from "@/scripts/page-metadata";
import { provideMetadataReceiver } from "@/scripts/page-metadata";
import { Router } from "@/nirax";
import { defaultStore } from "@/store";
import icon from "@/scripts/icon";
const props = defineProps<{

View File

@ -22,7 +22,7 @@
<script lang="ts" setup>
import preprocess from "@/scripts/preprocess";
const props = defineProps<{
defineProps<{
text: string;
}>();
</script>

View File

@ -15,7 +15,7 @@ import type * as firefish from "firefish-js";
import XNoteHeader from "@/components/MkNoteHeader.vue";
import MkSubNoteContent from "@/components/MkSubNoteContent.vue";
const props = defineProps<{
defineProps<{
note: firefish.entities.Note;
pinned?: boolean;
}>();

View File

@ -45,7 +45,7 @@ import { scroll } from "@/scripts/scroll";
const tlEl = ref<HTMLElement>();
const props = defineProps<{
defineProps<{
pagination: Paging;
noGap?: boolean;
}>();

View File

@ -5,10 +5,9 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XValue from "./MkObjectView.value.vue";
const props = defineProps<{
defineProps<{
value: Record<string, unknown>;
}>();
</script>

View File

@ -35,7 +35,6 @@ import { VueDraggable } from "vue-draggable-plus";
import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue";
import * as os from "@/os";
import { i18n } from "@/i18n";
import { defaultStore } from "@/store";
import icon from "@/scripts/icon";
const props = defineProps({

View File

@ -9,7 +9,7 @@
</template>
<script lang="ts" setup>
const props = defineProps<{
defineProps<{
reaction: string;
customEmojis?: any[]; // TODO
noStyle?: boolean;

View File

@ -21,7 +21,7 @@
import MkTooltip from "./MkTooltip.vue";
import XReactionIcon from "@/components/MkReactionIcon.vue";
const props = defineProps<{
defineProps<{
reaction: string;
emojis: any[]; // TODO
targetElement: HTMLElement;

View File

@ -32,7 +32,7 @@
import MkTooltip from "./MkTooltip.vue";
import XReactionIcon from "@/components/MkReactionIcon.vue";
const props = defineProps<{
defineProps<{
reaction: string;
users: any[]; // TODO
count: number;

View File

@ -128,12 +128,12 @@
</template>
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref } from "vue";
import { defineAsyncComponent, ref } from "vue";
import { toUnicode } from "punycode/";
import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/form/input.vue";
import MkInfo from "@/components/MkInfo.vue";
import { apiUrl, host as configHost } from "@/config";
import { host as configHost } from "@/config";
import { byteify, hexify } from "@/scripts/2fa";
import * as os from "@/os";
import { login } from "@/account";

View File

@ -18,7 +18,7 @@ import MkSignin from "@/components/MkSignin.vue";
import XModalWindow from "@/components/MkModalWindow.vue";
import { i18n } from "@/i18n";
const props = withDefaults(
withDefaults(
defineProps<{
autoSet?: boolean;
message?: string;

View File

@ -26,7 +26,7 @@ import XSignup from "@/components/MkSignup.vue";
import XModalWindow from "@/components/MkModalWindow.vue";
import { i18n } from "@/i18n";
const props = withDefaults(
withDefaults(
defineProps<{
autoSet?: boolean;
}>(),

View File

@ -31,7 +31,7 @@ import type { Paging } from "@/components/MkPagination.vue";
import MkPagination from "@/components/MkPagination.vue";
import { i18n } from "@/i18n";
const props = defineProps<{
defineProps<{
pagination: Paging;
noGap?: boolean;
}>();

View File

@ -18,10 +18,9 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import MkTooltip from "./MkTooltip.vue";
const props = defineProps<{
defineProps<{
users: any[]; // TODO
count: number;
targetElement: HTMLElement;

View File

@ -128,7 +128,6 @@ import { nextTick, ref, shallowRef, watch } from "vue";
import type * as firefish from "firefish-js";
import MkModal from "@/components/MkModal.vue";
import { i18n } from "@/i18n";
import { defaultStore } from "@/store";
import icon from "@/scripts/icon";
const modal = shallowRef<InstanceType<typeof MkModal>>();

View File

@ -1,3 +1,3 @@
export default {
mounted: (el) => el.focus(),
mounted: (el: HTMLElement) => el.focus(),
};

View File

@ -1,5 +1,5 @@
import type { Directive } from "vue";
import { makeHotkey } from "../scripts/hotkey";
import { makeHotkey } from "@/scripts/hotkey";
export default {
mounted(el, binding) {

View File

@ -1,8 +1,9 @@
import Ripple from "@/components/MkRipple.vue";
import { popup } from "@/os";
import type { Ref } from "vue";
export default {
mounted(el, binding, vn) {
mounted(el: HTMLElement, binding: Ref<boolean>) {
// 明示的に false であればバインドしない
if (binding.value === false) return;

View File

@ -1,5 +1,5 @@
import type { Directive } from "vue";
import { vibrate } from "../scripts/vibrate";
import { vibrate } from "@/scripts/vibrate";
export default {
mounted(el, binding) {

View File

@ -1,3 +1,5 @@
export const notePage = (note) => {
import { entities } from "firefish-js";
export const notePage = (note: entities.Note) => {
return `/notes/${note.id}`;
};

View File

@ -1 +1 @@
export default (n) => (n == null ? "N/A" : n.toLocaleString());
export default (n?: number) => (n == null ? "N/A" : n.toLocaleString());

View File

@ -36,7 +36,7 @@ import { set } from "@/scripts/idb-proxy";
import widgets from "@/widgets";
import directives from "@/directives";
import components from "@/components";
import { host, lang, ui, version } from "@/config";
import { lang, ui, version } from "@/config";
import { applyTheme } from "@/scripts/theme";
import { isDeviceDarkmode } from "@/scripts/is-device-darkmode";
import { i18n } from "@/i18n";

View File

@ -2,7 +2,7 @@
import { EventEmitter } from "eventemitter3";
import type { Component, ShallowRef } from "vue";
import { Ref, ref, shallowRef } from "vue";
import { shallowRef } from "vue";
import { pleaseLogin } from "@/scripts/please-login";
import { safeURIDecode } from "@/scripts/safe-uri-decode";

View File

@ -1,5 +1,3 @@
<template>
<div></div>
</template>
<script lang="ts" setup></script>

View File

@ -1,5 +1,3 @@
<template>
<MkLoading />
</template>
<script lang="ts" setup></script>

View File

@ -92,8 +92,8 @@ const fetching = ref(true);
const usage = ref<any>(null);
const capacity = ref<any>(null);
const uploadFolder = ref<any>(null);
const alwaysMarkNsfw = ref<boolean>($i.alwaysMarkNsfw);
const autoSensitive = ref<boolean>($i.autoSensitive);
const alwaysMarkNsfw = ref<boolean>($i != null && $i.alwaysMarkNsfw);
const autoSensitive = ref<boolean>($i != null && $i.autoSensitive);
const meterStyle = computed(() => {
return {

View File

@ -35,7 +35,7 @@ import * as os from "@/os";
import { i18n } from "@/i18n";
import icon from "@/scripts/icon";
const props = withDefaults(
withDefaults(
defineProps<{
user: firefish.entities.User;
limit?: number;

View File

@ -5,18 +5,17 @@ import { iAmModerator } from "@/account";
import { $i } from "@/reactiveAccount";
import MkLoading from "@/pages/_loading_.vue";
import MkError from "@/pages/_error_.vue";
import { api } from "@/os";
import { ui } from "@/config";
// import { api } from "@/os";
function getGuestTimelineStatus() {
api("meta", {
detail: false,
}).then((meta) => {
return meta.enableGuestTimeline;
});
}
// function getGuestTimelineStatus() {
// api("meta", {
// detail: false,
// }).then((meta) => {
// return meta.enableGuestTimeline;
// });
// }
const guestTimeline = getGuestTimelineStatus();
// const guestTimeline = getGuestTimelineStatus();
const page = (loader: AsyncComponentLoader<any>) =>
defineAsyncComponent({

View File

@ -1,5 +1,5 @@
import type { Ref } from "vue";
import { defineAsyncComponent, inject } from "vue";
import { defineAsyncComponent } from "vue";
import type * as firefish from "firefish-js";
import { $i } from "@/reactiveAccount";
import { i18n } from "@/i18n";

View File

@ -1,5 +1,4 @@
import type * as firefish from "firefish-js";
import { i18n } from "@/i18n";
/**
* 稿

View File

@ -1,5 +1,3 @@
import { Ref } from "vue";
export function calcPopupPosition(
el: HTMLElement,
props: {

View File

@ -1,7 +1,7 @@
import type { Ref } from "vue";
import { inject, onUnmounted } from "vue";
import { i18n } from "@/i18n";
import * as os from "@/os";
// import { inject, onUnmounted } from "vue";
// import { i18n } from "@/i18n";
// import * as os from "@/os";
export function useLeaveGuard(enabled: Ref<boolean>) {
/* TODO

View File

@ -19,7 +19,7 @@
<script lang="ts" setup>
import { defineAsyncComponent } from "vue";
import { swInject } from "./sw-inject";
import { pendingApiRequestsCount, popup, popups } from "@/os";
import { popup, popups } from "@/os";
import { uploads } from "@/scripts/upload";
import * as sound from "@/scripts/sound";
import { $i } from "@/reactiveAccount";

View File

@ -126,14 +126,7 @@
</template>
<script lang="ts" setup>
import {
computed,
defineAsyncComponent,
defineComponent,
ref,
toRef,
watch,
} from "vue";
import { computed, defineAsyncComponent, toRef } from "vue";
import * as os from "@/os";
import { navbarItemDef } from "@/navbar";
import { openAccountMenu as openAccountMenu_ } from "@/account";

View File

@ -39,13 +39,11 @@
</template>
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref, toRef, watch } from "vue";
import { ref } from "vue";
import type * as firefish from "firefish-js";
import MarqueeText from "@/components/MkMarquee.vue";
import * as os from "@/os";
import { useInterval } from "@/scripts/use-interval";
import { getNoteSummary } from "@/scripts/get-note-summary";
import { notePage } from "@/filters/note";
import { getProxiedImageUrlNullable } from "@/scripts/media-proxy";
const props = defineProps<{

View File

@ -27,9 +27,8 @@
</template>
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref, toRef, watch } from "vue";
import { ref } from "vue";
import MarqueeText from "@/components/MkMarquee.vue";
import * as os from "@/os";
import { useInterval } from "@/scripts/use-interval";
import { shuffle } from "@/scripts/shuffle";

View File

@ -34,7 +34,7 @@
</template>
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref, toRef, watch } from "vue";
import { ref } from "vue";
import type * as firefish from "firefish-js";
import MarqueeText from "@/components/MkMarquee.vue";
import * as os from "@/os";

View File

@ -49,8 +49,7 @@
</template>
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref, toRef, watch } from "vue";
import * as os from "@/os";
import { defineAsyncComponent } from "vue";
import { defaultStore } from "@/store";
const XRss = defineAsyncComponent(() => import("./statusbar-rss.vue"));
const XFederation = defineAsyncComponent(

View File

@ -1,8 +1,6 @@
import { inject } from "vue";
import { post } from "@/os";
import { login } from "@/account";
import { $i } from "@/reactiveAccount";
import { defaultStore } from "@/store";
import { getAccountFromId } from "@/scripts/get-account-from-id";
import { mainRouter } from "@/router";

View File

@ -58,7 +58,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XMainColumn from "./main-column.vue";
import XTlColumn from "./tl-column.vue";
import XAntennaColumn from "./antenna-column.vue";

View File

@ -2,7 +2,6 @@ import { throttle } from "throttle-debounce";
import { markRaw } from "vue";
import type { notificationTypes } from "firefish-js";
import { Storage } from "../../pizzax";
import { i18n } from "@/i18n";
import { api } from "@/os";
import { deepClone } from "@/scripts/clone";

View File

@ -4,11 +4,10 @@
</template>
<script lang="ts">
import { defineAsyncComponent, defineComponent } from "vue";
import { defineComponent } from "vue";
import DesignA from "./visitor/a.vue";
import DesignB from "./visitor/b.vue";
import XCommon from "./_common_/common.vue";
import { i18n } from "@/i18n";
export default defineComponent({
components: {

View File

@ -74,7 +74,7 @@
</template>
<script lang="ts">
import { defineAsyncComponent, defineComponent } from "vue";
import { defineComponent } from "vue";
import XHeader from "./header.vue";
import { host, instanceName } from "@/config";
import { search } from "@/scripts/search";

View File

@ -81,7 +81,7 @@
</template>
<script lang="ts">
import { defineAsyncComponent, defineComponent } from "vue";
import { defineComponent } from "vue";
import { host, instanceName } from "@/config";
import * as os from "@/os";
import MkPagination from "@/components/MkPagination.vue";

View File

@ -7,14 +7,9 @@
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, ref, watch } from "vue";
import { AiScript, parse, utils } from "@syuilo/aiscript";
import { AiScript, parse } from "@syuilo/aiscript";
import type { Widget, WidgetComponentExpose } from "./widget";
import {
WidgetComponentEmits,
WidgetComponentProps,
useWidgetPropsManager,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import * as os from "@/os";
import { createAiScriptEnv } from "@/scripts/aiscript/api";

View File

@ -44,13 +44,9 @@
</template>
<script lang="ts" setup>
import { onUnmounted, ref } from "vue";
import { ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import {
WidgetComponentEmits,
WidgetComponentProps,
useWidgetPropsManager,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import { i18n } from "@/i18n";
import { useInterval } from "@/scripts/use-interval";

View File

@ -49,11 +49,7 @@
import { computed } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import {
WidgetComponentEmits,
WidgetComponentProps,
useWidgetPropsManager,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import MkContainer from "@/components/MkContainer.vue";
import MkAnalogClock from "@/components/MkAnalogClock.vue";

View File

@ -15,7 +15,7 @@
</template>
<script lang="ts" setup>
import { computed, onUnmounted, ref, watch } from "vue";
import { computed } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import {
WidgetComponentEmits,

View File

@ -22,11 +22,7 @@
<script lang="ts" setup>
import { ref, shallowRef } from "vue";
import {
WidgetComponentEmits,
WidgetComponentProps,
useWidgetPropsManager,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { Widget, WidgetComponentExpose } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import MkContainer from "@/components/MkContainer.vue";

View File

@ -20,13 +20,9 @@
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, ref } from "vue";
import { ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import {
WidgetComponentEmits,
WidgetComponentProps,
useWidgetPropsManager,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import * as os from "@/os";
import { useInterval } from "@/scripts/use-interval";

View File

@ -8,13 +8,8 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import {
WidgetComponentEmits,
WidgetComponentProps,
useWidgetPropsManager,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import XPostForm from "@/components/MkPostForm.vue";

View File

@ -31,11 +31,7 @@
<script lang="ts" setup>
import type { Widget, WidgetComponentExpose } from "./widget";
import {
WidgetComponentEmits,
WidgetComponentProps,
useWidgetPropsManager,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import { host } from "@/config";
@ -48,12 +44,7 @@ type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const { widgetProps, configure } = useWidgetPropsManager(
name,
widgetPropsDef,
props,
emit,
);
const { configure } = useWidgetPropsManager(name, widgetPropsDef, props, emit);
defineExpose<WidgetComponentExpose>({
name,

View File

@ -23,13 +23,9 @@
</template>
<script lang="ts" setup>
import { nextTick, onMounted, onUnmounted, reactive, ref } from "vue";
import { onMounted, ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import {
WidgetComponentEmits,
WidgetComponentProps,
useWidgetPropsManager,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import * as os from "@/os";
import { useInterval } from "@/scripts/use-interval";

View File

@ -19,11 +19,7 @@
<script lang="ts" setup>
import { onUnmounted, ref, watch } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import {
WidgetComponentEmits,
WidgetComponentProps,
useWidgetPropsManager,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
const name = "unixClock";