chore(web): new lint setup (#30020)

Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
Stephen Zhou
2025-12-23 16:58:55 +08:00
committed by GitHub
parent 9701a2994b
commit f2842da397
3356 changed files with 85046 additions and 81278 deletions

View File

@ -1,8 +1,9 @@
import Toast, { type IToastProps } from '@/app/components/base/toast'
import type { GitHubRepoReleaseResponse } from '../types'
import type { IToastProps } from '@/app/components/base/toast'
import Toast from '@/app/components/base/toast'
import { GITHUB_ACCESS_TOKEN } from '@/config'
import { uploadGitHub } from '@/service/plugins'
import { compareVersion, getLatestVersion } from '@/utils/semver'
import type { GitHubRepoReleaseResponse } from '../types'
import { GITHUB_ACCESS_TOKEN } from '@/config'
const formatReleases = (releases: any) => {
return releases.map((release: any) => ({
@ -20,7 +21,8 @@ export const useGitHubReleases = () => {
if (!GITHUB_ACCESS_TOKEN) {
// Fetch releases without authentication from client
const res = await fetch(`https://api.github.com/repos/${owner}/${repo}/releases`)
if (!res.ok) throw new Error('Failed to fetch repository releases')
if (!res.ok)
throw new Error('Failed to fetch repository releases')
const data = await res.json()
return formatReleases(data)
}
@ -28,7 +30,8 @@ export const useGitHubReleases = () => {
// Fetch releases with authentication from server
const res = await fetch(`/repos/${owner}/${repo}/releases`)
const bodyJson = await res.json()
if (bodyJson.status !== 200) throw new Error(bodyJson.data.message)
if (bodyJson.status !== 200)
throw new Error(bodyJson.data.message)
return formatReleases(bodyJson.data)
}
}
@ -83,7 +86,7 @@ export const useGitHubUpload = () => {
repoUrl: string,
selectedVersion: string,
selectedPackage: string,
onSuccess?: (GitHubPackage: { manifest: any; unique_identifier: string }) => void,
onSuccess?: (GitHubPackage: { manifest: any, unique_identifier: string }) => void,
) => {
try {
const response = await uploadGitHub(repoUrl, selectedVersion, selectedPackage)
@ -91,7 +94,8 @@ export const useGitHubUpload = () => {
manifest: response.manifest,
unique_identifier: response.unique_identifier,
}
if (onSuccess) onSuccess(GitHubPackage)
if (onSuccess)
onSuccess(GitHubPackage)
return GitHubPackage
}
catch (error) {