chore(deps): update dependency @antfu/eslint-config to v3 (#2984)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: TAKAHASHI Shuuji <shuuji3@gmail.com>
This commit is contained in:
parent
97826c00bc
commit
320ddc0e28
65 changed files with 359 additions and 523 deletions
|
@ -1,5 +1,5 @@
|
|||
import { LRUCache } from 'lru-cache'
|
||||
import type { mastodon } from 'masto'
|
||||
import { LRUCache } from 'lru-cache'
|
||||
|
||||
const cache = new LRUCache<string, any>({
|
||||
max: 1000,
|
||||
|
@ -25,11 +25,10 @@ export function fetchStatus(id: string, force = false): Promise<mastodon.v1.Stat
|
|||
if (cached && !force)
|
||||
return Promise.resolve(cached)
|
||||
|
||||
const promise = useMastoClient().v1.statuses.$select(id).fetch()
|
||||
.then((status) => {
|
||||
cacheStatus(status)
|
||||
return status
|
||||
})
|
||||
const promise = useMastoClient().v1.statuses.$select(id).fetch().then((status) => {
|
||||
cacheStatus(status)
|
||||
return status
|
||||
})
|
||||
cache.set(key, promise)
|
||||
return promise
|
||||
}
|
||||
|
@ -46,14 +45,13 @@ export function fetchAccountById(id?: string | null): Promise<mastodon.v1.Accoun
|
|||
return Promise.resolve(cached)
|
||||
|
||||
const domain = getInstanceDomainFromServer(server)
|
||||
const promise = useMastoClient().v1.accounts.$select(id).fetch()
|
||||
.then((r) => {
|
||||
if (r.acct && !r.acct.includes('@') && domain)
|
||||
r.acct = `${r.acct}@${domain}`
|
||||
const promise = useMastoClient().v1.accounts.$select(id).fetch().then((r) => {
|
||||
if (r.acct && !r.acct.includes('@') && domain)
|
||||
r.acct = `${r.acct}@${domain}`
|
||||
|
||||
cacheAccount(r, server, true)
|
||||
return r
|
||||
})
|
||||
cacheAccount(r, server, true)
|
||||
return r
|
||||
})
|
||||
cache.set(key, promise)
|
||||
return promise
|
||||
}
|
||||
|
@ -101,11 +99,10 @@ export function fetchTag(tagName: string, force = false): Promise<mastodon.v1.Ta
|
|||
if (cached && !force)
|
||||
return Promise.resolve(cached)
|
||||
|
||||
const promise = useMastoClient().v1.tags.$select(tagName).fetch()
|
||||
.then((tag) => {
|
||||
cacheTag(tag)
|
||||
return tag
|
||||
})
|
||||
const promise = useMastoClient().v1.tags.$select(tagName).fetch().then((tag) => {
|
||||
cacheTag(tag)
|
||||
return tag
|
||||
})
|
||||
cache.set(key, promise)
|
||||
return promise
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { ComputedRef } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import Fuse from 'fuse.js'
|
||||
import type { LocaleObject } from '@nuxtjs/i18n'
|
||||
import type { ComputedRef } from 'vue'
|
||||
import Fuse from 'fuse.js'
|
||||
import { defineStore } from 'pinia'
|
||||
import type { SearchResult } from '~/composables/masto/search'
|
||||
|
||||
// @unocss-include
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// @unimport-disable
|
||||
import type { mastodon } from 'masto'
|
||||
import type { Node } from 'ultrahtml'
|
||||
import { DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE, h, parse, render } from 'ultrahtml'
|
||||
import { findAndReplaceEmojisInText } from '@iconify/utils'
|
||||
import { decode } from 'tiny-decode'
|
||||
import { DOCUMENT_NODE, ELEMENT_NODE, h, parse, render, TEXT_NODE } from 'ultrahtml'
|
||||
import { emojiRegEx, getEmojiAttributes } from '../config/emojis'
|
||||
|
||||
export interface ContentParseOptions {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { ELEMENT_NODE, TEXT_NODE } from 'ultrahtml'
|
||||
import type { ElementNode, Node } from 'ultrahtml'
|
||||
import { Fragment, h, isVNode } from 'vue'
|
||||
import type { VNode } from 'vue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { decode } from 'tiny-decode'
|
||||
import type { ContentParseOptions } from './content-parse'
|
||||
import { parseMastodonHTML } from './content-parse'
|
||||
import Emoji from '~/components/emoji/Emoji.vue'
|
||||
import ContentCode from '~/components/content/ContentCode.vue'
|
||||
import ContentMentionGroup from '~/components/content/ContentMentionGroup.vue'
|
||||
import { decode } from 'tiny-decode'
|
||||
import { ELEMENT_NODE, TEXT_NODE } from 'ultrahtml'
|
||||
import { Fragment, h, isVNode } from 'vue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import AccountHoverWrapper from '~/components/account/AccountHoverWrapper.vue'
|
||||
import TagHoverWrapper from '~/components/account/TagHoverWrapper.vue'
|
||||
import ContentCode from '~/components/content/ContentCode.vue'
|
||||
import ContentMentionGroup from '~/components/content/ContentMentionGroup.vue'
|
||||
import Emoji from '~/components/emoji/Emoji.vue'
|
||||
import { parseMastodonHTML } from './content-parse'
|
||||
|
||||
function getTextualAstComponents(astChildren: Node[]): string {
|
||||
return astChildren
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { mastodon } from 'masto'
|
||||
import type { ConfirmDialogChoice, ConfirmDialogOptions, DraftItem, ErrorDialogData } from '~/types'
|
||||
import { STORAGE_KEY_FIRST_VISIT } from '~/constants'
|
||||
import type { ConfirmDialogChoice, ConfirmDialogOptions, DraftItem, ErrorDialogData } from '~/types'
|
||||
|
||||
export const confirmDialogChoice = ref<ConfirmDialogChoice>()
|
||||
export const confirmDialogLabel = ref<ConfirmDialogOptions>()
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { Pausable } from '@vueuse/core'
|
||||
import type { mastodon } from 'masto'
|
||||
import { createRestAPIClient, createStreamingAPIClient } from 'masto'
|
||||
import type { Ref } from 'vue'
|
||||
import type { ElkInstance } from '../users'
|
||||
import { createRestAPIClient, createStreamingAPIClient } from 'masto'
|
||||
import type { UserLogin } from '~/types'
|
||||
|
||||
export function createMasto() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { fileOpen } from 'browser-fs-access'
|
||||
import type { Ref } from 'vue'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { DraftItem } from '~~/types'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { Ref } from 'vue'
|
||||
import { fileOpen } from 'browser-fs-access'
|
||||
|
||||
export function usePublish(options: {
|
||||
draftItem: Ref<DraftItem>
|
||||
|
@ -45,16 +45,16 @@ export function usePublish(options: {
|
|||
|| failedMessages.value.length > 0
|
||||
|| (attachments.length > 0 && params.poll !== null && params.poll !== undefined)
|
||||
|| ((params.poll !== null && params.poll !== undefined)
|
||||
&& (
|
||||
(firstEmptyInputIndex !== -1
|
||||
&& firstEmptyInputIndex !== params.poll.options.length - 1
|
||||
)
|
||||
|| params.poll.options.findLastIndex(option => option.trim().length > 0) + 1 < 2
|
||||
|| (new Set(params.poll.options).size !== params.poll.options.length)
|
||||
|| (currentInstance.value?.configuration?.polls.maxCharactersPerOption !== undefined
|
||||
&& params.poll.options.find(option => option.length > currentInstance.value!.configuration!.polls.maxCharactersPerOption) !== undefined
|
||||
)
|
||||
))
|
||||
&& (
|
||||
(firstEmptyInputIndex !== -1
|
||||
&& firstEmptyInputIndex !== params.poll.options.length - 1
|
||||
)
|
||||
|| params.poll.options.findLastIndex(option => option.trim().length > 0) + 1 < 2
|
||||
|| (new Set(params.poll.options).size !== params.poll.options.length)
|
||||
|| (currentInstance.value?.configuration?.polls.maxCharactersPerOption !== undefined
|
||||
&& params.poll.options.find(option => option.length > currentInstance.value!.configuration!.polls.maxCharactersPerOption) !== undefined
|
||||
)
|
||||
))
|
||||
})
|
||||
|
||||
watch(draftItem, () => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { withoutProtocol } from 'ufo'
|
||||
import type { mastodon } from 'masto'
|
||||
import { withoutProtocol } from 'ufo'
|
||||
|
||||
export function getAccountRoute(account: mastodon.v1.Account) {
|
||||
return useRouter().resolve({
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Node } from 'ultrahtml'
|
||||
import { decode } from 'tiny-decode'
|
||||
import { TEXT_NODE, parse } from 'ultrahtml'
|
||||
import { parse, TEXT_NODE } from 'ultrahtml'
|
||||
|
||||
export const maxAccountFieldCount = computed(() => isGlitchEdition.value ? 16 : 4)
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { Ref } from 'vue'
|
||||
import type { LocaleObject } from '@nuxtjs/i18n'
|
||||
import type { Ref } from 'vue'
|
||||
import type { FontSize, OldFontSize, PreferencesSettings, UserSettings } from './definition'
|
||||
import { STORAGE_KEY_SETTINGS } from '~/constants'
|
||||
import { oldFontSizeMap } from '~~/constants/options'
|
||||
import { STORAGE_KEY_SETTINGS } from '~/constants'
|
||||
|
||||
export function useUserSettings() {
|
||||
const { locales } = useNuxtApp().$i18n
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
import type { Editor } from '@tiptap/vue-3'
|
||||
import { Extension, useEditor } from '@tiptap/vue-3'
|
||||
import Placeholder from '@tiptap/extension-placeholder'
|
||||
import Document from '@tiptap/extension-document'
|
||||
import Paragraph from '@tiptap/extension-paragraph'
|
||||
import Text from '@tiptap/extension-text'
|
||||
import Mention from '@tiptap/extension-mention'
|
||||
import HardBreak from '@tiptap/extension-hard-break'
|
||||
import Bold from '@tiptap/extension-bold'
|
||||
import Italic from '@tiptap/extension-italic'
|
||||
import Code from '@tiptap/extension-code'
|
||||
import History from '@tiptap/extension-history'
|
||||
import { Plugin } from 'prosemirror-state'
|
||||
|
||||
import type { Ref } from 'vue'
|
||||
import { TiptapEmojiSuggestion, TiptapHashtagSuggestion, TiptapMentionSuggestion } from './tiptap/suggestion'
|
||||
import { TiptapPluginCodeBlockShiki } from './tiptap/shiki'
|
||||
import Bold from '@tiptap/extension-bold'
|
||||
import Code from '@tiptap/extension-code'
|
||||
import Document from '@tiptap/extension-document'
|
||||
import HardBreak from '@tiptap/extension-hard-break'
|
||||
import History from '@tiptap/extension-history'
|
||||
import Italic from '@tiptap/extension-italic'
|
||||
import Mention from '@tiptap/extension-mention'
|
||||
import Paragraph from '@tiptap/extension-paragraph'
|
||||
import Placeholder from '@tiptap/extension-placeholder'
|
||||
import Text from '@tiptap/extension-text'
|
||||
import { Extension, useEditor } from '@tiptap/vue-3'
|
||||
|
||||
import { Plugin } from 'prosemirror-state'
|
||||
import { TiptapPluginCustomEmoji } from './tiptap/custom-emoji'
|
||||
import { TiptapPluginEmoji } from './tiptap/emoji'
|
||||
import { TiptapPluginCodeBlockShiki } from './tiptap/shiki'
|
||||
import { TiptapEmojiSuggestion, TiptapHashtagSuggestion, TiptapMentionSuggestion } from './tiptap/suggestion'
|
||||
|
||||
export interface UseTiptapOptions {
|
||||
content: Ref<string>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
Node,
|
||||
mergeAttributes,
|
||||
Node,
|
||||
nodeInputRule,
|
||||
} from '@tiptap/core'
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type { ExtendedRegExpMatchArray, InputRuleFinder, nodeInputRule } from '@tiptap/core'
|
||||
import type { NodeType } from '@tiptap/pm/model'
|
||||
import {
|
||||
InputRule,
|
||||
Node,
|
||||
callOrReturn,
|
||||
InputRule,
|
||||
mergeAttributes,
|
||||
Node,
|
||||
nodePasteRule,
|
||||
} from '@tiptap/core'
|
||||
import { emojiRegEx, getEmojiAttributes } from '~/config/emojis'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { type Parser, createParser } from 'prosemirror-highlight/shiki'
|
||||
import type { BuiltinLanguage } from 'shiki'
|
||||
import { createParser, type Parser } from 'prosemirror-highlight/shiki'
|
||||
|
||||
let parser: Parser | undefined
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ import CodeBlock from '@tiptap/extension-code-block'
|
|||
import { VueNodeViewRenderer } from '@tiptap/vue-3'
|
||||
|
||||
import { createHighlightPlugin } from 'prosemirror-highlight'
|
||||
import { shikiParser } from './shiki-parser'
|
||||
import TiptapCodeBlock from '~/components/tiptap/TiptapCodeBlock.vue'
|
||||
import { shikiParser } from './shiki-parser'
|
||||
|
||||
export const TiptapPluginCodeBlockShiki = CodeBlock.extend({
|
||||
addOptions() {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import type { GetReferenceClientRect, Instance } from 'tippy.js'
|
||||
import tippy from 'tippy.js'
|
||||
import { VueRenderer } from '@tiptap/vue-3'
|
||||
import type { SuggestionOptions } from '@tiptap/suggestion'
|
||||
import { PluginKey } from 'prosemirror-state'
|
||||
import type { Component } from 'vue'
|
||||
import type { Emoji, EmojiMartData } from '@emoji-mart/data'
|
||||
import type { SuggestionOptions } from '@tiptap/suggestion'
|
||||
import type { mastodon } from 'masto'
|
||||
import { currentCustomEmojis, updateCustomEmojis } from '~/composables/emojis'
|
||||
import TiptapMentionList from '~/components/tiptap/TiptapMentionList.vue'
|
||||
import TiptapHashtagList from '~/components/tiptap/TiptapHashtagList.vue'
|
||||
import type { GetReferenceClientRect, Instance } from 'tippy.js'
|
||||
import type { Component } from 'vue'
|
||||
import { VueRenderer } from '@tiptap/vue-3'
|
||||
import { PluginKey } from 'prosemirror-state'
|
||||
import tippy from 'tippy.js'
|
||||
import TiptapEmojiList from '~/components/tiptap/TiptapEmojiList.vue'
|
||||
import TiptapHashtagList from '~/components/tiptap/TiptapHashtagList.vue'
|
||||
import TiptapMentionList from '~/components/tiptap/TiptapMentionList.vue'
|
||||
import { currentCustomEmojis, updateCustomEmojis } from '~/composables/emojis'
|
||||
|
||||
export type { Emoji }
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import { withoutProtocol } from 'ufo'
|
||||
import type { MaybeRefOrGetter, RemovableRef } from '@vueuse/core'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { EffectScope, Ref } from 'vue'
|
||||
import type { MaybeRefOrGetter, RemovableRef } from '@vueuse/core'
|
||||
import type { ElkMasto } from './masto/masto'
|
||||
import type { UserLogin } from '~/types'
|
||||
import type { Overwrite } from '~/types/utils'
|
||||
import { withoutProtocol } from 'ufo'
|
||||
import type { PushNotificationPolicy, PushNotificationRequest } from '~/composables/push-notifications/types'
|
||||
import {
|
||||
DEFAULT_POST_CHARS_LIMIT,
|
||||
STORAGE_KEY_CURRENT_USER_HANDLE,
|
||||
|
@ -13,7 +12,8 @@ import {
|
|||
STORAGE_KEY_NOTIFICATION_POLICY,
|
||||
STORAGE_KEY_SERVERS,
|
||||
} from '~/constants'
|
||||
import type { PushNotificationPolicy, PushNotificationRequest } from '~/composables/push-notifications/types'
|
||||
import type { UserLogin } from '~/types'
|
||||
import type { Overwrite } from '~/types/utils'
|
||||
|
||||
const mock = process.mock
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { SchemaAugmentations } from '@unhead/schema'
|
||||
import type { ActiveHeadEntry, UseHeadInput, UseHeadOptions } from '@unhead/vue'
|
||||
import type { ComponentInternalInstance } from 'vue'
|
||||
import { onActivated, onDeactivated, ref } from 'vue'
|
||||
import type { ActiveHeadEntry, UseHeadInput, UseHeadOptions } from '@unhead/vue'
|
||||
import type { SchemaAugmentations } from '@unhead/schema'
|
||||
|
||||
export const isHydrated = ref(false)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue