🎨 chore(web): apply ESLint and Prettier auto-fixes (baseline)

- Ran: bun run eslint:fix && bun run lint:fix
- Inserted AGPL license header via eslint-plugin-header
- Enforced no-multiple-empty-lines and other lint rules
- Formatted code using Prettier v3 (@so1ve/prettier-config)
- No functional changes; formatting-only baseline across JS/JSX files
This commit is contained in:
t0ng7u
2025-08-30 21:15:10 +08:00
parent 41cf516ec5
commit 0d57b1acd4
274 changed files with 11025 additions and 7659 deletions
@@ -32,13 +32,13 @@ const AccountDeleteModal = ({
userState,
turnstileEnabled,
turnstileSiteKey,
setTurnstileToken
setTurnstileToken,
}) => {
return (
<Modal
title={
<div className="flex items-center">
<IconDelete className="mr-2 text-red-500" />
<div className='flex items-center'>
<IconDelete className='mr-2 text-red-500' />
{t('删除账户确认')}
</div>
}
@@ -47,35 +47,37 @@ const AccountDeleteModal = ({
onOk={deleteAccount}
size={'small'}
centered={true}
className="modern-modal"
className='modern-modal'
>
<div className="space-y-4 py-4">
<div className='space-y-4 py-4'>
<Banner
type='danger'
description={t('您正在删除自己的帐户,将清空所有数据且不可恢复')}
closeIcon={null}
className="!rounded-lg"
className='!rounded-lg'
/>
<div>
<Typography.Text strong className="block mb-2 text-red-600">
<Typography.Text strong className='block mb-2 text-red-600'>
{t('请输入您的用户名以确认删除')}
</Typography.Text>
<Input
placeholder={t('输入你的账户名{{username}}以确认删除', { username: ` ${userState?.user?.username} ` })}
placeholder={t('输入你的账户名{{username}}以确认删除', {
username: ` ${userState?.user?.username} `,
})}
name='self_account_deletion_confirmation'
value={inputs.self_account_deletion_confirmation}
onChange={(value) =>
handleInputChange('self_account_deletion_confirmation', value)
}
size="large"
className="!rounded-lg"
size='large'
className='!rounded-lg'
prefix={<IconUser />}
/>
</div>
{turnstileEnabled && (
<div className="flex justify-center">
<div className='flex justify-center'>
<Turnstile
sitekey={turnstileSiteKey}
onVerify={(token) => {
@@ -31,13 +31,13 @@ const ChangePasswordModal = ({
changePassword,
turnstileEnabled,
turnstileSiteKey,
setTurnstileToken
setTurnstileToken,
}) => {
return (
<Modal
title={
<div className="flex items-center">
<IconLock className="mr-2 text-orange-500" />
<div className='flex items-center'>
<IconLock className='mr-2 text-orange-500' />
{t('修改密码')}
</div>
}
@@ -46,43 +46,45 @@ const ChangePasswordModal = ({
onOk={changePassword}
size={'small'}
centered={true}
className="modern-modal"
className='modern-modal'
>
<div className="space-y-4 py-4">
<div className='space-y-4 py-4'>
<div>
<Typography.Text strong className="block mb-2">{t('原密码')}</Typography.Text>
<Typography.Text strong className='block mb-2'>
{t('原密码')}
</Typography.Text>
<Input
name='original_password'
placeholder={t('请输入原密码')}
type='password'
value={inputs.original_password}
onChange={(value) =>
handleInputChange('original_password', value)
}
size="large"
className="!rounded-lg"
onChange={(value) => handleInputChange('original_password', value)}
size='large'
className='!rounded-lg'
prefix={<IconLock />}
/>
</div>
<div>
<Typography.Text strong className="block mb-2">{t('新密码')}</Typography.Text>
<Typography.Text strong className='block mb-2'>
{t('新密码')}
</Typography.Text>
<Input
name='set_new_password'
placeholder={t('请输入新密码')}
type='password'
value={inputs.set_new_password}
onChange={(value) =>
handleInputChange('set_new_password', value)
}
size="large"
className="!rounded-lg"
onChange={(value) => handleInputChange('set_new_password', value)}
size='large'
className='!rounded-lg'
prefix={<IconLock />}
/>
</div>
<div>
<Typography.Text strong className="block mb-2">{t('确认新密码')}</Typography.Text>
<Typography.Text strong className='block mb-2'>
{t('确认新密码')}
</Typography.Text>
<Input
name='set_new_password_confirmation'
placeholder={t('请再次输入新密码')}
@@ -91,14 +93,14 @@ const ChangePasswordModal = ({
onChange={(value) =>
handleInputChange('set_new_password_confirmation', value)
}
size="large"
className="!rounded-lg"
size='large'
className='!rounded-lg'
prefix={<IconLock />}
/>
</div>
{turnstileEnabled && (
<div className="flex justify-center">
<div className='flex justify-center'>
<Turnstile
sitekey={turnstileSiteKey}
onVerify={(token) => {
@@ -35,13 +35,13 @@ const EmailBindModal = ({
countdown,
turnstileEnabled,
turnstileSiteKey,
setTurnstileToken
setTurnstileToken,
}) => {
return (
<Modal
title={
<div className="flex items-center">
<IconMail className="mr-2 text-blue-500" />
<div className='flex items-center'>
<IconMail className='mr-2 text-blue-500' />
{t('绑定邮箱地址')}
</div>
}
@@ -51,28 +51,30 @@ const EmailBindModal = ({
size={'small'}
centered={true}
maskClosable={false}
className="modern-modal"
className='modern-modal'
>
<div className="space-y-4 py-4">
<div className="flex gap-3">
<div className='space-y-4 py-4'>
<div className='flex gap-3'>
<Input
placeholder={t('输入邮箱地址')}
onChange={(value) => handleInputChange('email', value)}
name='email'
type='email'
size="large"
className="!rounded-lg flex-1"
size='large'
className='!rounded-lg flex-1'
prefix={<IconMail />}
/>
<Button
onClick={sendVerificationCode}
disabled={disableButton || loading}
className="!rounded-lg"
type="primary"
theme="outline"
className='!rounded-lg'
type='primary'
theme='outline'
size='large'
>
{disableButton ? `${t('重新发送')} (${countdown})` : t('获取验证码')}
{disableButton
? `${t('重新发送')} (${countdown})`
: t('获取验证码')}
</Button>
</div>
@@ -83,13 +85,13 @@ const EmailBindModal = ({
onChange={(value) =>
handleInputChange('email_verification_code', value)
}
size="large"
className="!rounded-lg"
size='large'
className='!rounded-lg'
prefix={<IconKey />}
/>
{turnstileEnabled && (
<div className="flex justify-center">
<div className='flex justify-center'>
<Turnstile
sitekey={turnstileSiteKey}
onVerify={(token) => {
@@ -29,13 +29,13 @@ const WeChatBindModal = ({
inputs,
handleInputChange,
bindWeChat,
status
status,
}) => {
return (
<Modal
title={
<div className="flex items-center">
<SiWechat className="mr-2 text-green-500" size={20} />
<div className='flex items-center'>
<SiWechat className='mr-2 text-green-500' size={20} />
{t('绑定微信账户')}
</div>
}
@@ -44,30 +44,30 @@ const WeChatBindModal = ({
footer={null}
size={'small'}
centered={true}
className="modern-modal"
className='modern-modal'
>
<div className="space-y-4 py-4 text-center">
<Image src={status.wechat_qrcode} className="mx-auto" />
<div className="text-gray-600">
<p>{t('微信扫码关注公众号,输入「验证码」获取验证码(三分钟内有效)')}</p>
<div className='space-y-4 py-4 text-center'>
<Image src={status.wechat_qrcode} className='mx-auto' />
<div className='text-gray-600'>
<p>
{t('微信扫码关注公众号,输入「验证码」获取验证码(三分钟内有效)')}
</p>
</div>
<Input
placeholder={t('验证码')}
name='wechat_verification_code'
value={inputs.wechat_verification_code}
onChange={(v) =>
handleInputChange('wechat_verification_code', v)
}
size="large"
className="!rounded-lg"
onChange={(v) => handleInputChange('wechat_verification_code', v)}
size='large'
className='!rounded-lg'
prefix={<IconKey />}
/>
<Button
type="primary"
theme="solid"
type='primary'
theme='solid'
size='large'
onClick={bindWeChat}
className="!rounded-lg w-full !bg-slate-600 hover:!bg-slate-700"
className='!rounded-lg w-full !bg-slate-600 hover:!bg-slate-700'
icon={<SiWechat size={16} />}
>
{t('绑定')}