🎨 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 105b86c660
commit 6a87808612
274 changed files with 11025 additions and 7659 deletions

View File

@@ -49,10 +49,8 @@ const ColumnSelectorModal = ({
visible={showColumnSelector}
onCancel={() => setShowColumnSelector(false)}
footer={
<div className="flex justify-end">
<Button onClick={() => initDefaultColumns()}>
{t('重置')}
</Button>
<div className='flex justify-end'>
<Button onClick={() => initDefaultColumns()}>{t('重置')}</Button>
<Button onClick={() => setShowColumnSelector(false)}>
{t('取消')}
</Button>
@@ -75,7 +73,7 @@ const ColumnSelectorModal = ({
</Checkbox>
</div>
<div
className="flex flex-wrap max-h-96 overflow-y-auto rounded-lg p-4"
className='flex flex-wrap max-h-96 overflow-y-auto rounded-lg p-4'
style={{ border: '1px solid var(--semi-color-border)' }}
>
{allColumns.map((column) => {
@@ -90,7 +88,7 @@ const ColumnSelectorModal = ({
}
return (
<div key={column.key} className="w-1/2 mb-4 pr-2">
<div key={column.key} className='w-1/2 mb-4 pr-2'>
<Checkbox
checked={!!visibleColumns[column.key]}
onChange={(e) =>
@@ -107,4 +105,4 @@ const ColumnSelectorModal = ({
);
};
export default ColumnSelectorModal;
export default ColumnSelectorModal;

View File

@@ -28,7 +28,7 @@ const UserInfoModal = ({
t,
}) => {
const infoItemStyle = {
marginBottom: '16px'
marginBottom: '16px',
};
const labelStyle = {
@@ -37,7 +37,7 @@ const UserInfoModal = ({
marginBottom: '2px',
fontSize: '12px',
color: 'var(--semi-color-text-2)',
gap: '6px'
gap: '6px',
};
const renderLabel = (text, type = 'tertiary') => (
@@ -50,19 +50,19 @@ const UserInfoModal = ({
const valueStyle = {
fontSize: '14px',
fontWeight: '600',
color: 'var(--semi-color-text-0)'
color: 'var(--semi-color-text-0)',
};
const rowStyle = {
display: 'flex',
justifyContent: 'space-between',
marginBottom: '16px',
gap: '20px'
gap: '20px',
};
const colStyle = {
flex: 1,
minWidth: 0
minWidth: 0,
};
return (
@@ -100,7 +100,9 @@ const UserInfoModal = ({
</div>
<div style={colStyle}>
{renderLabel(t('已用额度'), 'warning')}
<div style={valueStyle}>{renderQuota(userInfoData.used_quota)}</div>
<div style={valueStyle}>
{renderQuota(userInfoData.used_quota)}
</div>
</div>
</div>
@@ -108,7 +110,9 @@ const UserInfoModal = ({
<div style={rowStyle}>
<div style={colStyle}>
{renderLabel(t('请求次数'), 'warning')}
<div style={valueStyle}>{renderNumber(userInfoData.request_count)}</div>
<div style={valueStyle}>
{renderNumber(userInfoData.request_count)}
</div>
</div>
{userInfoData.group && (
<div style={colStyle}>
@@ -130,25 +134,38 @@ const UserInfoModal = ({
{userInfoData.aff_count !== undefined && (
<div style={colStyle}>
{renderLabel(t('邀请人数'), 'tertiary')}
<div style={valueStyle}>{renderNumber(userInfoData.aff_count)}</div>
<div style={valueStyle}>
{renderNumber(userInfoData.aff_count)}
</div>
</div>
)}
</div>
)}
{/* 邀请获得额度 */}
{userInfoData.aff_quota !== undefined && userInfoData.aff_quota > 0 && (
<div style={infoItemStyle}>
{renderLabel(t('邀请获得额度'), 'success')}
<div style={valueStyle}>{renderQuota(userInfoData.aff_quota)}</div>
</div>
)}
{userInfoData.aff_quota !== undefined &&
userInfoData.aff_quota > 0 && (
<div style={infoItemStyle}>
{renderLabel(t('邀请获得额度'), 'success')}
<div style={valueStyle}>
{renderQuota(userInfoData.aff_quota)}
</div>
</div>
)}
{/* 备注 */}
{userInfoData.remark && (
<div style={{ marginBottom: 0 }}>
{renderLabel(t('备注'), 'tertiary')}
<div style={{ ...valueStyle, wordBreak: 'break-all', lineHeight: '1.4' }}>{userInfoData.remark}</div>
<div
style={{
...valueStyle,
wordBreak: 'break-all',
lineHeight: '1.4',
}}
>
{userInfoData.remark}
</div>
</div>
)}
</div>
@@ -157,4 +174,4 @@ const UserInfoModal = ({
);
};
export default UserInfoModal;
export default UserInfoModal;