chore: lint

This commit is contained in:
naskya 2024-03-02 14:24:05 +09:00
parent 860bda8921
commit 4c38d9665e
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
30 changed files with 71 additions and 46 deletions

View file

@ -21,7 +21,7 @@ const TIME_2000: i64 = 946_684_800_000;
const TIMESTAMP_LENGTH: u16 = 8;
/// Initializes Cuid2 generator. Must be called before any [create_id].
pub fn init_id<'a>(length: u16, fingerprint: &'a str) {
pub fn init_id(length: u16, fingerprint: &str) {
FINGERPRINT.get_or_init(move || format!("{}{}", fingerprint, cuid2::create_id()));
GENERATOR.get_or_init(move || {
cuid2::CuidConstructor::new()

View file

@ -3,8 +3,8 @@
*/
import { EventEmitter } from "node:events";
import boot from "./boot/index.js";
import { inspect } from "node:util";
import boot from "./boot/index.js";
Error.stackTraceLimit = Infinity;
EventEmitter.defaultMaxListeners = 128;

View file

@ -92,10 +92,10 @@ import {
ref,
watch,
} from "vue";
import { acct } from "firefish-js";
import contains from "@/scripts/contains";
import { char2filePath } from "@/scripts/twemoji-base";
import { getStaticImageUrl } from "@/scripts/get-static-image-url";
import { acct } from "firefish-js";
import * as os from "@/os";
import { MFM_TAGS } from "@/scripts/mfm-tags";
import { defaultStore } from "@/store";

View file

@ -65,8 +65,8 @@
</template>
<script lang="ts" setup>
import { i18n } from "@/i18n";
import { acct } from "firefish-js";
import { i18n } from "@/i18n";
import { $i } from "@/reactiveAccount";
defineProps<{

View file

@ -2,7 +2,9 @@
<div
ref="ticker"
v-tooltip="
`${capitalize(instance.softwareName)} ${instance.softwareVersion ?? ''}`
`${capitalize(instance.softwareName)} ${
instance.softwareVersion ?? ''
}`
"
class="hpaizdrt"
:style="bg"

View file

@ -167,7 +167,7 @@
<script lang="ts" setup>
import { onMounted, onUnmounted, onUpdated, ref } from "vue";
import type { entities, StreamTypes } from "firefish-js";
import type { StreamTypes, entities } from "firefish-js";
import MkTab from "@/components/MkTab.vue";
import MkNote from "@/components/MkNote.vue";
import MkNoteSub from "@/components/MkNoteSub.vue";

View file

@ -79,9 +79,9 @@
</button>
<button
v-if="!showBigPostButton"
v-tooltip="submitText"
class="submit _buttonGradate"
:disabled="!canPost"
v-tooltip="submitText"
data-cy-open-post-form-submit
@click="post"
>
@ -244,9 +244,9 @@
</button>
<div v-if="showBigPostButton">
<button
v-tooltip="submitText"
class="submit bigPostButton"
:disabled="!canPost"
v-tooltip="submitText"
data-cy-open-post-form-submit
@click="post"
>
@ -289,7 +289,8 @@ import autosize from "autosize";
import insertTextAtCursor from "insert-text-at-cursor";
import { length } from "stringz";
import { toASCII } from "punycode/";
import { acct, noteVisibilities, languages, type entities } from "firefish-js";
import { acct } from "firefish-js";
import type { entities, languages, noteVisibilities } from "firefish-js";
import { throttle } from "throttle-debounce";
import XNoteSimple from "@/components/MkNoteSimple.vue";
import XNotePreview from "@/components/MkNotePreview.vue";
@ -315,7 +316,7 @@ import XCheatSheet from "@/components/MkCheatSheetDialog.vue";
import preprocess from "@/scripts/preprocess";
import { vibrate } from "@/scripts/vibrate";
import { langmap } from "@/scripts/langmap";
import { MenuItem } from "@/types/menu";
import type { MenuItem } from "@/types/menu";
import detectLanguage from "@/scripts/detect-language";
import icon from "@/scripts/icon";
@ -755,8 +756,8 @@ function filterLangmapByPrefix(
if (prefix === "zh")
to_return = to_return.concat([
{ langCode: "yue", nativeName: langmap["yue"].nativeName },
{ langCode: "nan", nativeName: langmap["nan"].nativeName },
{ langCode: "yue", nativeName: langmap.yue.nativeName },
{ langCode: "nan", nativeName: langmap.nan.nativeName },
]);
return to_return;

View file

@ -21,7 +21,7 @@
<script lang="ts" setup>
import { shallowRef } from "vue";
import { noteVisibilities, languages, type entities } from "firefish-js";
import type { entities, languages, noteVisibilities } from "firefish-js";
import MkModal from "@/components/MkModal.vue";
import MkPostForm from "@/components/MkPostForm.vue";

View file

@ -94,7 +94,7 @@ function moveBySystem(to: number): Promise<void> {
return;
}
const startTime = Date.now();
let intervalId = setInterval(() => {
const intervalId = setInterval(() => {
const time = Date.now() - startTime;
if (time > RELEASE_TRANSITION_DURATION) {
pullDistance.value = to;

View file

@ -3,8 +3,8 @@
:initial-width="800"
:can-resize="true"
:front="true"
@closed="emit('closed')"
class="thppypvi"
@closed="emit('closed')"
>
<template #header>
{{ title }}

View file

@ -44,6 +44,7 @@
<script lang="ts" setup>
import { computed, onUnmounted, provide, ref } from "vue";
import type { Endpoints } from "firefish-js";
import MkPullToRefresh from "@/components/MkPullToRefresh.vue";
import XNotes from "@/components/MkNotes.vue";
import MkInfo from "@/components/MkInfo.vue";
@ -54,7 +55,6 @@ import { i18n } from "@/i18n";
import { defaultStore } from "@/store";
import icon from "@/scripts/icon";
import type { Paging } from "@/components/MkPagination.vue";
import type { Endpoints } from "firefish-js";
const props = defineProps<{
src: string;
@ -74,7 +74,23 @@ const tlComponent = ref<InstanceType<typeof XNotes>>();
const pullToRefreshComponent = ref<InstanceType<typeof MkPullToRefresh>>();
let endpoint = ""; // keyof Endpoints
let query, connection, connection2;
let query: {
antennaId?: string | undefined;
withReplies?: boolean;
visibility?: string;
listId?: string | undefined;
channelId?: string | undefined;
fileId?: string | undefined;
};
let connection: {
on: (
arg0: string,
arg1: { (note: any): void; (note: any): void; (note: any): void },
) => void;
dispose: () => void;
};
let connection2: { dispose: () => void } | null;
let tlHint: string;
let tlHintClosed: boolean;
let tlNotesCount = 0;

View file

@ -21,8 +21,8 @@
></i>
<i
v-else-if="note.visibility === 'specified'"
v-tooltip="i18n.ts.private"
ref="specified"
v-tooltip="i18n.ts.private"
:class="icon('ph-eye-slash')"
></i>
</span>

View file

@ -22,6 +22,7 @@
</span>
<span
v-else-if="showLightBox"
ref="gallery"
v-user-preview="disablePreview ? undefined : user.id"
class="eiwwqkts _noSelect showLightBox"
:class="{
@ -32,7 +33,6 @@
}"
:style="{ color }"
:title="acct.toString(user)"
ref="gallery"
@click.stop
>
<img class="inner avatar" :src="url" decoding="async" />
@ -70,13 +70,13 @@
<script lang="ts" setup>
import { computed, onMounted, ref, watch } from "vue";
import { acct, type entities } from "firefish-js";
import PhotoSwipeLightbox from "photoswipe/lightbox";
import PhotoSwipe from "photoswipe";
import { getStaticImageUrl } from "@/scripts/get-static-image-url";
import { extractAvgColorFromBlurhash } from "@/scripts/extract-avg-color-from-blurhash";
import { userPage } from "@/filters/user";
import MkUserOnlineIndicator from "@/components/MkUserOnlineIndicator.vue";
import { defaultStore } from "@/store";
import PhotoSwipeLightbox from "photoswipe/lightbox";
import PhotoSwipe from "photoswipe";
import "photoswipe/style.css";
const props = withDefaults(

View file

@ -1,4 +1,5 @@
import { acct, type Acct, type entities } from "firefish-js";
import { acct } from "firefish-js";
import type { Acct, entities } from "firefish-js";
import { url } from "@/config";
export const userName = (user: entities.User) => {

View file

@ -40,6 +40,7 @@ import { i18n } from "@/i18n";
import { fetchInstance, instance } from "@/instance";
import { alert, api, confirm, popup, post, toast } from "@/os";
import { $i, isSignedIn } from "@/reactiveAccount";
import { compareFirefishVersions } from "@/scripts/compare-versions";
import { deviceKind } from "@/scripts/device-kind";
import { getAccountFromId } from "@/scripts/get-account-from-id";
import { makeHotkey } from "@/scripts/hotkey";
@ -52,9 +53,8 @@ import * as sound from "@/scripts/sound";
import { applyTheme } from "@/scripts/theme";
import { reloadChannel } from "@/scripts/unison-reload";
import { ColdDeviceStorage, defaultStore } from "@/store";
import { useStream, isReloading } from "@/stream";
import { isReloading, useStream } from "@/stream";
import widgets from "@/widgets";
import { compareFirefishVersions } from "@/scripts/compare-versions";
function checkForSplash() {
const splash = document.getElementById("splash");

View file

@ -1,7 +1,7 @@
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
import { EventEmitter } from "eventemitter3";
import { api as firefishApi, type entities } from "firefish-js";
import { type entities, api as firefishApi } from "firefish-js";
import insertTextAtCursor from "insert-text-at-cursor";
import type { Component, Ref } from "vue";
import { defineAsyncComponent, markRaw, ref } from "vue";

View file

@ -92,7 +92,7 @@ import FormSection from "@/components/form/section.vue";
import MkButton from "@/components/MkButton.vue";
import { physics } from "@/scripts/physics";
import { i18n } from "@/i18n";
import { defaultStore, defaultReactions } from "@/store";
import { defaultReactions, defaultStore } from "@/store";
import * as os from "@/os";
import { definePageMetadata } from "@/scripts/page-metadata";
import icon from "@/scripts/icon";

View file

@ -1,6 +1,10 @@
<template>
<div>
<XDrive ref="drive" @cd="(x) => (folder = x)" :fullPageHeader="true" />
<XDrive
ref="drive"
:full-page-header="true"
@cd="(x) => (folder = x)"
/>
</div>
</template>

View file

@ -64,8 +64,8 @@
<script lang="ts" setup>
import { computed, ref } from "vue";
import MkPagination from "@/components/MkPagination.vue";
import { acct } from "firefish-js";
import MkPagination from "@/components/MkPagination.vue";
import { userPage } from "@/filters/user";
import * as os from "@/os";
import { i18n } from "@/i18n";

View file

@ -83,8 +83,8 @@
<script lang="ts" setup>
import { computed, ref } from "vue";
import MkPagination from "@/components/MkPagination.vue";
import { acct } from "firefish-js";
import MkPagination from "@/components/MkPagination.vue";
import { userPage } from "@/filters/user";
import * as os from "@/os";
import { i18n } from "@/i18n";

View file

@ -105,7 +105,7 @@ import {
ref,
watch,
} from "vue";
import type { entities, Channels, ChannelConnection } from "firefish-js";
import type { ChannelConnection, Channels, entities } from "firefish-js";
import { acct } from "firefish-js";
import XMessage from "./messaging-room.message.vue";
import XForm from "./messaging-room.form.vue";

View file

@ -33,7 +33,8 @@
import { computed, ref } from "vue";
// SPECIFICATION: https://misskey-hub.net/docs/features/share-form.html
import { acct, noteVisibilities, type entities } from "firefish-js";
import type { entities } from "firefish-js";
import { acct, noteVisibilities } from "firefish-js";
import MkButton from "@/components/MkButton.vue";
import XPostForm from "@/components/MkPostForm.vue";
import * as os from "@/os";

View file

@ -118,7 +118,7 @@
</div>
<MkAvatar
class="avatar"
:showLightBox="true"
:show-light-box="true"
:user="user"
:disable-preview="true"
:show-indicator="true"
@ -384,7 +384,7 @@ import { userPage } from "@/filters/user";
import { defaultStore } from "@/store";
import * as os from "@/os";
import { i18n } from "@/i18n";
import { $i, isSignedIn, isModerator } from "@/reactiveAccount";
import { $i, isModerator, isSignedIn } from "@/reactiveAccount";
import { host } from "@/config";
import icon from "@/scripts/icon";

View file

@ -1,9 +1,9 @@
import type { AsyncComponentLoader } from "vue";
import { defineAsyncComponent, inject } from "vue";
import { $i, isModerator, isEmojiMod } from "@/reactiveAccount";
import { Router } from "@/nirax";
import MkError from "@/pages/_error_.vue";
import MkLoading from "@/pages/_loading_.vue";
import { $i, isEmojiMod, isModerator } from "@/reactiveAccount";
const page = (loader: AsyncComponentLoader<any>) =>
defineAsyncComponent({

View file

@ -1,7 +1,7 @@
import type { Ref } from "vue";
import { defineAsyncComponent } from "vue";
import type { entities } from "firefish-js";
import { $i, isSignedIn, isModerator } from "@/reactiveAccount";
import { $i, isModerator, isSignedIn } from "@/reactiveAccount";
import { i18n } from "@/i18n";
import { instance } from "@/instance";
import * as os from "@/os";

View file

@ -5,7 +5,7 @@ import { $i } from "@/reactiveAccount";
let stream: Stream | null = null;
let timeoutHeartBeat: number | null = null;
export let isReloading: boolean = false;
export let isReloading = false;
export function useStream() {
if (stream != null) return stream;

View file

@ -19,7 +19,7 @@
<script lang="ts" setup>
import { onUnmounted, ref } from "vue";
import { useStream, isReloading } from "@/stream";
import { isReloading, useStream } from "@/stream";
import { i18n } from "@/i18n";
import { defaultStore } from "@/store";

View file

@ -50,7 +50,7 @@ import type { Column } from "./deck-store";
import { removeColumn, updateColumn } from "./deck-store";
import XTimeline from "@/components/MkTimeline.vue";
import * as os from "@/os";
import { isSignedIn, isModerator } from "@/reactiveAccount";
import { isModerator, isSignedIn } from "@/reactiveAccount";
import { instance } from "@/instance";
import { i18n } from "@/i18n";
import icon from "@/scripts/icon";

View file

@ -11,30 +11,30 @@ import {
DetailedInstanceMetadata,
DriveFile,
DriveFolder,
FollowRequest,
Following,
FollowingFolloweePopulated,
FollowingFollowerPopulated,
FollowRequest,
GalleryPost,
Instance,
InstanceMetadata,
LiteInstanceMetadata,
MeDetailed,
MessagingMessage,
Note,
NoteFavorite,
NoteReaction,
Notification,
OriginType,
Page,
ServerInfo,
Signin,
Stats,
User,
UserDetailed,
UserGroup,
UserList,
UserSorting,
Notification,
NoteReaction,
Signin,
MessagingMessage,
} from "./entities";
type TODO = Record<string, any> | null;

View file

@ -27,9 +27,9 @@ export function urlQuery(
const params = Object.entries(obj)
.filter(([, v]) => (Array.isArray(v) ? v.length : v !== undefined))
.reduce(
// rome-ignore lint/suspicious/noAssignInExpressions: <Used for key assigning>
// rome-ignore lint/style/noNonNullAssertion: <>
// rome-ignore lint/style/noCommaOperator: <>
// biome-ignore lint/suspicious/noAssignInExpressions: <Used for key assigning>
// biome-ignore lint/style/noNonNullAssertion: <>
// biome-ignore lint/style/noCommaOperator: <>
(a, [k, v]) => ((a[k] = v!), a),
{} as Record<string, string | number | boolean>,
);