Skip to content

Commit 320ddc0

Browse files
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 <[email protected]>
1 parent 97826c0 commit 320ddc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+348
-512
lines changed

components/command/CommandPanel.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import type { SearchResult as SearchResultType } from '~/composables/masto/search'
32
import type { CommandScope, QueryResult, QueryResultItem } from '~/composables/command'
3+
import type { SearchResult as SearchResultType } from '~/composables/masto/search'
44
55
const emit = defineEmits<{
66
(event: 'close'): void

components/common/CommonInputImage.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import { fileOpen } from 'browser-fs-access'
32
import type { FileWithHandle } from 'browser-fs-access'
3+
import { fileOpen } from 'browser-fs-access'
44
55
const props = withDefaults(defineProps<{
66
/** The image src before change */

components/common/CommonPaginator.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts" generic="T, O, U = T">
2+
import type { mastodon } from 'masto'
23
// @ts-expect-error missing types
34
import { DynamicScroller } from 'vue-virtual-scroller'
45
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
5-
import type { mastodon } from 'masto'
66
77
const {
88
paginator,

components/modal/ModalContainer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import type { mastodon } from 'masto'
3-
import type { ConfirmDialogChoice } from '~/types'
43
import {
54
isCommandPanelOpen,
65
isConfirmDialogOpen,
@@ -14,6 +13,7 @@ import {
1413
isReportDialogOpen,
1514
isSigninDialogOpen,
1615
} from '~/composables/dialog'
16+
import type { ConfirmDialogChoice } from '~/types'
1717
1818
const isMac = useIsMac()
1919

components/modal/ModalMediaPreviewCarousel.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
22
import type { Vector2 } from '@vueuse/gesture'
3+
import type { mastodon } from 'masto'
34
import { useGesture } from '@vueuse/gesture'
45
import { useReducedMotion } from '@vueuse/motion'
5-
import type { mastodon } from 'masto'
66
77
const { media = [] } = defineProps<{
88
media?: mastodon.v1.MediaAttachment[]

components/nav/NavBottom.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import type { Component } from 'vue'
33
import type { NavButtonName } from '../../composables/settings'
44
5-
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
6-
75
import { NavButtonExplore, NavButtonFederated, NavButtonHome, NavButtonLocal, NavButtonMention, NavButtonMoreMenu, NavButtonNotification, NavButtonSearch } from '#components'
86
7+
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
8+
99
interface NavButton {
1010
name: string
1111
component: Component

components/notification/NotificationPaginator.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2+
import type { mastodon } from 'masto'
23
// @ts-expect-error missing types
34
import { DynamicScrollerItem } from 'vue-virtual-scroller'
4-
import type { mastodon } from 'masto'
55
import type { GroupedAccountLike, NotificationSlot } from '~/types'
66
77
const { paginator, stream } = defineProps<{

components/publish/PublishEmojiPicker.client.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import importEmojiLang from 'virtual:emoji-mart-lang-importer'
32
import type { Picker } from 'emoji-mart'
3+
import importEmojiLang from 'virtual:emoji-mart-lang-importer'
44
55
const emit = defineEmits<{
66
(e: 'select', code: string): void

components/publish/PublishLanguagePicker.vue

+6-7
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ const fuse = new Fuse(languagesNameList, {
1616
const languages = computed(() =>
1717
languageKeyword.value.trim()
1818
? fuse.search(languageKeyword.value).map(r => r.item)
19-
: [...languagesNameList].filter(entry => !userSettings.value.disabledTranslationLanguages.includes(entry.code))
20-
.sort(({ code: a }, { code: b }) => {
21-
// Put English on the top
22-
if (a === 'en')
23-
return -1
19+
: [...languagesNameList].filter(entry => !userSettings.value.disabledTranslationLanguages.includes(entry.code)).sort(({ code: a }, { code: b }) => {
20+
// Put English on the top
21+
if (a === 'en')
22+
return -1
2423
25-
return a === modelValue.value ? -1 : b === modelValue.value ? 1 : a.localeCompare(b)
26-
}),
24+
return a === modelValue.value ? -1 : b === modelValue.value ? 1 : a.localeCompare(b)
25+
}),
2726
)
2827
2928
const preferredLanguages = computed(() => {

components/publish/PublishWidget.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2+
import type { mastodon } from 'masto'
23
import { EditorContent } from '@tiptap/vue-3'
34
import stringLength from 'string-length'
4-
import type { mastodon } from 'masto'
55
import type { DraftItem } from '~/types'
66
77
const {

components/settings/SettingsFontSize.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import { DEFAULT_FONT_SIZE } from '~/constants'
32
import type { FontSize } from '~/composables/settings'
3+
import { DEFAULT_FONT_SIZE } from '~/constants'
44
55
const userSettings = useUserSettings()
66

components/settings/SettingsItem.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ useCommand({
2020
scope: 'Settings',
2121
2222
name: () => props.text
23-
?? (props.to
24-
? typeof props.to === 'string'
25-
? props.to
26-
: props.to.name
27-
: ''
28-
),
23+
?? (props.to
24+
? typeof props.to === 'string'
25+
? props.to
26+
: props.to.name
27+
: ''
28+
),
2929
description: () => props.description,
3030
icon: () => props.icon || '',
3131
visible: () => props.command && props.to,

components/settings/SettingsLanguage.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import type { ComputedRef } from 'vue'
32
import type { LocaleObject } from '@nuxtjs/i18n'
3+
import type { ComputedRef } from 'vue'
44
55
const userSettings = useUserSettings()
66

components/status/StatusAttachment.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import { clamp } from '@vueuse/core'
32
import type { mastodon } from 'masto'
3+
import { clamp } from '@vueuse/core'
44
import { decode } from 'blurhash'
55
66
const {

components/status/StatusSpoiler.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const expandSpoilers = computed(() => {
1212
1313
return !props.filter // always prevent expansion if filtered
1414
&& ((props.sensitiveNonSpoiler && expandMedia)
15-
|| (!props.sensitiveNonSpoiler && expandCW))
15+
|| (!props.sensitiveNonSpoiler && expandCW))
1616
})
1717
1818
const hideContent = props.enabled || props.sensitiveNonSpoiler

components/timeline/TimelinePaginator.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
2+
import type { mastodon } from 'masto'
23
// @ts-expect-error missing types
34
import { DynamicScrollerItem } from 'vue-virtual-scroller'
45
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
5-
import type { mastodon } from 'masto'
66
77
const { paginator, stream, account, buffer = 10, endMessage = true } = defineProps<{
88
paginator: mastodon.Paginator<mastodon.v1.Status[], mastodon.rest.v1.ListAccountStatusesParams>

components/tiptap/TiptapCodeBlock.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { NodeViewContent, NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3'
2+
import { NodeViewContent, nodeViewProps, NodeViewWrapper } from '@tiptap/vue-3'
33
44
const props = defineProps(nodeViewProps)
55

components/tiptap/TiptapEmojiList.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
22
import { getEmojiMatchesInText } from '@iconify/utils/lib/emoji/replace/find'
3-
import type { CustomEmoji, Emoji } from '~/composables/tiptap/suggestion'
4-
import { isCustomEmoji } from '~/composables/tiptap/suggestion'
53
import { emojiFilename, emojiPrefix, emojiRegEx } from '~~/config/emojis'
64
import type { CommandHandler } from '~/composables/command'
5+
import type { CustomEmoji, Emoji } from '~/composables/tiptap/suggestion'
6+
import { isCustomEmoji } from '~/composables/tiptap/suggestion'
77
88
const { items, command } = defineProps<{
99
items: (CustomEmoji | Emoji)[]

composables/cache.ts

+15-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { LRUCache } from 'lru-cache'
21
import type { mastodon } from 'masto'
2+
import { LRUCache } from 'lru-cache'
33

44
const cache = new LRUCache<string, any>({
55
max: 1000,
@@ -25,11 +25,10 @@ export function fetchStatus(id: string, force = false): Promise<mastodon.v1.Stat
2525
if (cached && !force)
2626
return Promise.resolve(cached)
2727

28-
const promise = useMastoClient().v1.statuses.$select(id).fetch()
29-
.then((status) => {
30-
cacheStatus(status)
31-
return status
32-
})
28+
const promise = useMastoClient().v1.statuses.$select(id).fetch().then((status) => {
29+
cacheStatus(status)
30+
return status
31+
})
3332
cache.set(key, promise)
3433
return promise
3534
}
@@ -46,14 +45,13 @@ export function fetchAccountById(id?: string | null): Promise<mastodon.v1.Accoun
4645
return Promise.resolve(cached)
4746

4847
const domain = getInstanceDomainFromServer(server)
49-
const promise = useMastoClient().v1.accounts.$select(id).fetch()
50-
.then((r) => {
51-
if (r.acct && !r.acct.includes('@') && domain)
52-
r.acct = `${r.acct}@${domain}`
48+
const promise = useMastoClient().v1.accounts.$select(id).fetch().then((r) => {
49+
if (r.acct && !r.acct.includes('@') && domain)
50+
r.acct = `${r.acct}@${domain}`
5351

54-
cacheAccount(r, server, true)
55-
return r
56-
})
52+
cacheAccount(r, server, true)
53+
return r
54+
})
5755
cache.set(key, promise)
5856
return promise
5957
}
@@ -101,11 +99,10 @@ export function fetchTag(tagName: string, force = false): Promise<mastodon.v1.Ta
10199
if (cached && !force)
102100
return Promise.resolve(cached)
103101

104-
const promise = useMastoClient().v1.tags.$select(tagName).fetch()
105-
.then((tag) => {
106-
cacheTag(tag)
107-
return tag
108-
})
102+
const promise = useMastoClient().v1.tags.$select(tagName).fetch().then((tag) => {
103+
cacheTag(tag)
104+
return tag
105+
})
109106
cache.set(key, promise)
110107
return promise
111108
}

composables/command.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import type { LocaleObject } from '@nuxtjs/i18n'
12
import type { ComputedRef } from 'vue'
2-
import { defineStore } from 'pinia'
33
import Fuse from 'fuse.js'
4-
import type { LocaleObject } from '@nuxtjs/i18n'
4+
import { defineStore } from 'pinia'
55
import type { SearchResult } from '~/composables/masto/search'
66

77
// @unocss-include

composables/content-parse.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// @unimport-disable
22
import type { mastodon } from 'masto'
33
import type { Node } from 'ultrahtml'
4-
import { DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE, h, parse, render } from 'ultrahtml'
54
import { findAndReplaceEmojisInText } from '@iconify/utils'
65
import { decode } from 'tiny-decode'
6+
import { DOCUMENT_NODE, ELEMENT_NODE, h, parse, render, TEXT_NODE } from 'ultrahtml'
77
import { emojiRegEx, getEmojiAttributes } from '../config/emojis'
88

99
export interface ContentParseOptions {

composables/content-render.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { ELEMENT_NODE, TEXT_NODE } from 'ultrahtml'
21
import type { ElementNode, Node } from 'ultrahtml'
3-
import { Fragment, h, isVNode } from 'vue'
42
import type { VNode } from 'vue'
5-
import { RouterLink } from 'vue-router'
6-
import { decode } from 'tiny-decode'
73
import type { ContentParseOptions } from './content-parse'
8-
import { parseMastodonHTML } from './content-parse'
9-
import Emoji from '~/components/emoji/Emoji.vue'
10-
import ContentCode from '~/components/content/ContentCode.vue'
11-
import ContentMentionGroup from '~/components/content/ContentMentionGroup.vue'
4+
import { decode } from 'tiny-decode'
5+
import { ELEMENT_NODE, TEXT_NODE } from 'ultrahtml'
6+
import { Fragment, h, isVNode } from 'vue'
7+
import { RouterLink } from 'vue-router'
128
import AccountHoverWrapper from '~/components/account/AccountHoverWrapper.vue'
139
import TagHoverWrapper from '~/components/account/TagHoverWrapper.vue'
10+
import ContentCode from '~/components/content/ContentCode.vue'
11+
import ContentMentionGroup from '~/components/content/ContentMentionGroup.vue'
12+
import Emoji from '~/components/emoji/Emoji.vue'
13+
import { parseMastodonHTML } from './content-parse'
1414

1515
function getTextualAstComponents(astChildren: Node[]): string {
1616
return astChildren

composables/dialog.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { mastodon } from 'masto'
2-
import type { ConfirmDialogChoice, ConfirmDialogOptions, DraftItem, ErrorDialogData } from '~/types'
32
import { STORAGE_KEY_FIRST_VISIT } from '~/constants'
3+
import type { ConfirmDialogChoice, ConfirmDialogOptions, DraftItem, ErrorDialogData } from '~/types'
44

55
export const confirmDialogChoice = ref<ConfirmDialogChoice>()
66
export const confirmDialogLabel = ref<ConfirmDialogOptions>()

composables/masto/masto.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Pausable } from '@vueuse/core'
22
import type { mastodon } from 'masto'
3-
import { createRestAPIClient, createStreamingAPIClient } from 'masto'
43
import type { Ref } from 'vue'
54
import type { ElkInstance } from '../users'
5+
import { createRestAPIClient, createStreamingAPIClient } from 'masto'
66
import type { UserLogin } from '~/types'
77

88
export function createMasto() {

composables/masto/publish.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { fileOpen } from 'browser-fs-access'
2-
import type { Ref } from 'vue'
3-
import type { mastodon } from 'masto'
41
import type { DraftItem } from '~~/types'
2+
import type { mastodon } from 'masto'
3+
import type { Ref } from 'vue'
4+
import { fileOpen } from 'browser-fs-access'
55

66
export function usePublish(options: {
77
draftItem: Ref<DraftItem>
@@ -45,16 +45,16 @@ export function usePublish(options: {
4545
|| failedMessages.value.length > 0
4646
|| (attachments.length > 0 && params.poll !== null && params.poll !== undefined)
4747
|| ((params.poll !== null && params.poll !== undefined)
48-
&& (
49-
(firstEmptyInputIndex !== -1
50-
&& firstEmptyInputIndex !== params.poll.options.length - 1
51-
)
52-
|| params.poll.options.findLastIndex(option => option.trim().length > 0) + 1 < 2
53-
|| (new Set(params.poll.options).size !== params.poll.options.length)
54-
|| (currentInstance.value?.configuration?.polls.maxCharactersPerOption !== undefined
55-
&& params.poll.options.find(option => option.length > currentInstance.value!.configuration!.polls.maxCharactersPerOption) !== undefined
56-
)
57-
))
48+
&& (
49+
(firstEmptyInputIndex !== -1
50+
&& firstEmptyInputIndex !== params.poll.options.length - 1
51+
)
52+
|| params.poll.options.findLastIndex(option => option.trim().length > 0) + 1 < 2
53+
|| (new Set(params.poll.options).size !== params.poll.options.length)
54+
|| (currentInstance.value?.configuration?.polls.maxCharactersPerOption !== undefined
55+
&& params.poll.options.find(option => option.length > currentInstance.value!.configuration!.polls.maxCharactersPerOption) !== undefined
56+
)
57+
))
5858
})
5959

6060
watch(draftItem, () => {

composables/masto/routes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { withoutProtocol } from 'ufo'
21
import type { mastodon } from 'masto'
2+
import { withoutProtocol } from 'ufo'
33

44
export function getAccountRoute(account: mastodon.v1.Account) {
55
return useRouter().resolve({

composables/settings/metadata.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Node } from 'ultrahtml'
22
import { decode } from 'tiny-decode'
3-
import { TEXT_NODE, parse } from 'ultrahtml'
3+
import { parse, TEXT_NODE } from 'ultrahtml'
44

55
export const maxAccountFieldCount = computed(() => isGlitchEdition.value ? 16 : 4)
66

composables/settings/storage.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { Ref } from 'vue'
21
import type { LocaleObject } from '@nuxtjs/i18n'
2+
import type { Ref } from 'vue'
33
import type { FontSize, OldFontSize, PreferencesSettings, UserSettings } from './definition'
4-
import { STORAGE_KEY_SETTINGS } from '~/constants'
54
import { oldFontSizeMap } from '~~/constants/options'
5+
import { STORAGE_KEY_SETTINGS } from '~/constants'
66

77
export function useUserSettings() {
88
const { locales } = useNuxtApp().$i18n

0 commit comments

Comments
 (0)