chore(deps): update dependency @antfu/eslint-config to ^2.19.0 (#2726)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: TAKAHASHI Shuuji <shuuji3@gmail.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
renovate[bot] 2024-08-16 14:52:08 +00:00 committed by GitHub
parent 23f82d3296
commit 0fba07e6e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 820 additions and 710 deletions

View file

@ -38,12 +38,14 @@ onMounted(() => {
announce(t('a11y.loading_page'))
})
router.afterEach((to, from) => {
from && setTimeout(() => {
requestAnimationFrame(() => {
const title = document.title.trim().split('|')
announce(t('a11y.route_loaded', [title[0]]))
})
}, 512)
if (from) {
setTimeout(() => {
requestAnimationFrame(() => {
const title = document.title.trim().split('|')
announce(t('a11y.route_loaded', [title[0]]))
})
}, 512)
}
})
})
</script>

View file

@ -20,7 +20,7 @@ const tabs = computed(() => {
})
function toValidName(option: string) {
return option.toLowerCase().replace(/[^a-zA-Z0-9]/g, '-')
return option.toLowerCase().replace(/[^a-z0-9]/gi, '-')
}
useCommands(() => command

View file

@ -15,9 +15,10 @@ const isRemoved = ref(false)
async function edit() {
try {
isRemoved.value
? await client.v1.lists.$select(list).accounts.create({ accountIds: [account.id] })
: await client.v1.lists.$select(list).accounts.remove({ accountIds: [account.id] })
if (isRemoved.value)
await client.v1.lists.$select(list).accounts.create({ accountIds: [account.id] })
else
await client.v1.lists.$select(list).accounts.remove({ accountIds: [account.id] })
isRemoved.value = !isRemoved.value
}
catch (err) {

View file

@ -32,9 +32,10 @@ async function openEmojiPicker() {
picker.value = new Picker({
data: () => dataPromise,
onEmojiSelect({ native, src, alt, name }: any) {
native
? emit('select', native)
: emit('selectCustom', { src, alt, 'data-emoji-id': name })
if (native)
emit('select', native)
else
emit('selectCustom', { src, alt, 'data-emoji-id': name })
},
set: 'twitter',
theme: colorMode,

View file

@ -85,10 +85,12 @@ function trimPollOptions() {
const trimmedOptions = draft.value.params.poll!.options.slice(0, indexLastNonEmpty + 1)
if (currentInstance.value?.configuration
&& trimmedOptions.length >= currentInstance.value?.configuration?.polls.maxOptions)
&& trimmedOptions.length >= currentInstance.value?.configuration?.polls.maxOptions) {
draft.value.params.poll!.options = trimmedOptions
else
}
else {
draft.value.params.poll!.options = [...trimmedOptions, '']
}
}
function editPollOptionDraft(event: Event, index: number) {
@ -135,10 +137,10 @@ const characterCount = computed(() => {
let length = stringLength(text)
// taken from https://github.com/mastodon/mastodon/blob/07f8b4d1b19f734d04e69daeb4c3421ef9767aac/app/lib/text_formatter.rb
const linkRegex = /(https?:\/\/(www\.)?|xmpp:)\S+/g
const linkRegex = /(https?:\/\/|xmpp:)\S+/g
// taken from https://github.com/mastodon/mastodon/blob/af578e/app/javascript/mastodon/features/compose/util/counter.js
const countableMentionRegex = /(^|[^/\w])@(([a-z0-9_]+)@[a-z0-9.-]+[a-z0-9]+)/ig
const countableMentionRegex = /(^|[^/\w])@((\w+)@[a-z0-9.-]+[a-z0-9])/gi
// maximum of 23 chars per link
// https://github.com/elk-zone/elk/issues/1651

View file

@ -83,7 +83,8 @@ useIntersectionObserver(video, (entries) => {
entries.forEach((entry) => {
if (entry.intersectionRatio <= 0.75) {
ready && !video.value?.paused && video.value?.pause()
if (ready && !video.value?.paused)
video.value?.pause()
}
else {
video.value?.play().then(() => {

View file

@ -26,7 +26,7 @@ async function toggleFollowTag() {
emit('change')
}
catch (error) {
catch {
// eslint-disable-next-line vue/no-mutating-props
tag.following = previousFollowingState
}

View file

@ -27,7 +27,7 @@ function isValidUrl(str: string) {
new URL(str)
return true
}
catch (err) {
catch {
return false
}
}
@ -42,13 +42,16 @@ async function handleInput() {
if (
isValidUrl(`https://${input}`)
&& input.match(/^[a-z0-9-]+(\.[a-z0-9-]+)+(:[0-9]+)?$/i)
&& input.match(/^[a-z0-9-]+(\.[a-z0-9-]+)+(:\d+)?$/i)
// Do not hide the autocomplete if a result has an exact substring match on the input
&& !filteredServers.value.some(s => s.includes(input))
)
) {
autocompleteShow.value = false
else
}
else {
autocompleteShow.value = true
}
}
function toSelector(server: string) {