chore: upgrade eslint

This commit is contained in:
starknt
2024-01-07 16:42:25 +08:00
parent 14fd4ecbfc
commit 7b82e7dd4c
30 changed files with 612 additions and 328 deletions

View File

@@ -28,37 +28,37 @@ function isSupportedPage() {
if (
// homepage
/https?:\/\/bilibili.com\/?$/.test(currentUrl)
|| /https?:\/\/www.bilibili.com\/?$/.test(currentUrl)
|| /https?:\/\/www.bilibili.com\/index.html$/.test(currentUrl)
|| /https?:\/\/bilibili.com\/\?spm_id_from=.*/.test(currentUrl)
|| /https?:\/\/www.bilibili.com\/\?spm_id_from=(.)*/.test(currentUrl)
|| /https?:\/\/www.bilibili.com\/?$/.test(currentUrl)
|| /https?:\/\/www.bilibili.com\/index.html$/.test(currentUrl)
|| /https?:\/\/bilibili.com\/\?spm_id_from=.*/.test(currentUrl)
|| /https?:\/\/www.bilibili.com\/\?spm_id_from=(.)*/.test(currentUrl)
// video page
|| /https?:\/\/(www.)?bilibili.com\/video\/.*/.test(currentUrl)
// anime playback & movie page
|| /https?:\/\/(www.)?bilibili.com\/bangumi\/play\/.*/.test(currentUrl)
// watch later playlist
|| /https?:\/\/(www.)?bilibili.com\/list\/watchlater.*/.test(currentUrl)
// favorite playlist
|| /https?:\/\/(www.)?bilibili.com\/list\/ml.*/.test(currentUrl)
// search page
|| /https?:\/\/search.bilibili.com\.*/.test(currentUrl)
// moments
|| /https?:\/\/t.bilibili.com\.*/.test(currentUrl)
// moment detail
|| /https?:\/\/www.bilibili.com\/opus\/.*/.test(currentUrl)
// history page
|| /https?:\/\/(www.)?bilibili.com\/account\/history.*/.test(currentUrl)
// user space page
|| /https?:\/\/space.bilibili.com\.*/.test(currentUrl)
// notifications page
|| /https?:\/\/message.bilibili.com\.*/.test(currentUrl)
// bilibili channel page b站分区页面
|| /https?:\/\/www.bilibili.com\/v\/.*/.test(currentUrl)
// anime page
|| /https?:\/\/www.bilibili.com\/anime.*/.test(currentUrl)
// tv shows, movie, variety shows, mooc page
|| /https?:\/\/(www.)?bilibili.com\/(tv|movie|variety|mooc).*/.test(currentUrl))
// video page
|| /https?:\/\/(www.)?bilibili.com\/video\/.*/.test(currentUrl)
// anime playback & movie page
|| /https?:\/\/(www.)?bilibili.com\/bangumi\/play\/.*/.test(currentUrl)
// watch later playlist
|| /https?:\/\/(www.)?bilibili.com\/list\/watchlater.*/.test(currentUrl)
// favorite playlist
|| /https?:\/\/(www.)?bilibili.com\/list\/ml.*/.test(currentUrl)
// search page
|| /https?:\/\/search.bilibili.com\.*/.test(currentUrl)
// moments
|| /https?:\/\/t.bilibili.com\.*/.test(currentUrl)
// moment detail
|| /https?:\/\/www.bilibili.com\/opus\/.*/.test(currentUrl)
// history page
|| /https?:\/\/(www.)?bilibili.com\/account\/history.*/.test(currentUrl)
// user space page
|| /https?:\/\/space.bilibili.com\.*/.test(currentUrl)
// notifications page
|| /https?:\/\/message.bilibili.com\.*/.test(currentUrl)
// bilibili channel page b站分区页面
|| /https?:\/\/www.bilibili.com\/v\/.*/.test(currentUrl)
// anime page
|| /https?:\/\/www.bilibili.com\/anime.*/.test(currentUrl)
// tv shows, movie, variety shows, mooc page
|| /https?:\/\/(www.)?bilibili.com\/(tv|movie|variety|mooc).*/.test(currentUrl))
return true
else
return false
@@ -70,7 +70,7 @@ let beforeLoadedStyleEl: HTMLStyleElement
// We have to manually add a class to the <html> app to ensure that the transition effect is applied
if (
(settings.value.adaptToOtherPageStyles && settings.value.theme === 'dark')
|| (settings.value.adaptToOtherPageStyles && settings.value.theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches)
|| (settings.value.adaptToOtherPageStyles && settings.value.theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches)
)
document.documentElement.classList.add('bewly-design', 'dark')

View File

@@ -2,7 +2,7 @@
import { useToggle } from '@vueuse/core'
import { useI18n } from 'vue-i18n'
import browser from 'webextension-polyfill'
import type { Ref } from '@vue/runtime-dom'
import type { Ref } from 'vue'
import Home from './Home/Home.vue'
import Search from './Search/Search.vue'

View File

@@ -11,7 +11,7 @@ const { t } = useI18n()
const favoriteCategories = reactive<CategoryItem[]>([])
const favoriteResources = reactive<FavoriteItem[]>([])
const categoryOptions = reactive<Array<{ value: any; label: string }>>([])
const categoryOptions = reactive<Array<{ value: any, label: string }>>([])
const selectedCategory = ref<FavoriteCategory>()
const activatedCategoryCover = ref<string>('')
@@ -117,7 +117,7 @@ async function getFavoriteResources(
if (
res.data.medias === null
|| (res.data.medias.length < 20 && favoriteResources.length > 0)
|| (res.data.medias.length < 20 && favoriteResources.length > 0)
)
noMoreContent.value = true
}