chore(deps): update lint (#1928)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
This commit is contained in:
renovate[bot] 2023-03-30 19:01:24 +00:00 committed by GitHub
parent 2838e18ff7
commit 3c43a1cdd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 464 additions and 434 deletions

View file

@ -26,12 +26,14 @@ const query = $computed(() => commandMode ? '' : input.trim())
const { accounts, hashtags, loading } = useSearch($$(query))
const toSearchQueryResultItem = (search: SearchResultType): QueryResultItem => ({
index: 0,
type: 'search',
search,
onActivate: () => router.push(search.to),
})
function toSearchQueryResultItem(search: SearchResultType): QueryResultItem {
return {
index: 0,
type: 'search',
search,
onActivate: () => router.push(search.to),
}
}
const searchResult = $computed<QueryResult>(() => {
if (query.length === 0 || loading.value)
@ -73,9 +75,10 @@ watch($$(result), (n, o) => {
active = 0
})
const findItemEl = (index: number) =>
resultEl?.querySelector(`[data-index="${index}"]`) as HTMLDivElement | null
const onCommandActivate = (item: QueryResultItem) => {
function findItemEl(index: number) {
return resultEl?.querySelector(`[data-index="${index}"]`) as HTMLDivElement | null
}
function onCommandActivate(item: QueryResultItem) {
if (item.onActivate) {
item.onActivate()
emit('close')
@ -85,7 +88,7 @@ const onCommandActivate = (item: QueryResultItem) => {
input = '> '
}
}
const onCommandComplete = (item: QueryResultItem) => {
function onCommandComplete(item: QueryResultItem) {
if (item.onComplete) {
scopes.push(item.onComplete())
input = '> '
@ -95,7 +98,7 @@ const onCommandComplete = (item: QueryResultItem) => {
emit('close')
}
}
const intoView = (index: number) => {
function intoView(index: number) {
const el = findItemEl(index)
if (el)
el.scrollIntoView({ block: 'nearest' })
@ -107,7 +110,7 @@ function setActive(index: number) {
intoView(active)
}
const onKeyDown = (e: KeyboardEvent) => {
function onKeyDown(e: KeyboardEvent) {
switch (e.key) {
case 'p':
case 'ArrowUp': {