Skip to content

Commit 63a2bd4

Browse files
committed
fix: 修复ESLint错误 - 正则表达式转义、分号、测试文件any类型
1 parent 0f3928d commit 63a2bd4

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

.eslintrc.cjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ module.exports = {
1313
'react-hooks/exhaustive-deps': 'off',
1414
'react-refresh/only-export-components': 'off',
1515
},
16+
overrides: [
17+
{
18+
files: ['**/__tests__/**/*.ts', '**/__tests__/**/*.tsx', '**/*.test.ts', '**/*.test.tsx'],
19+
rules: {
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
},
22+
},
23+
],
1624
}

src/page/other/HumanizedValueInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function HumanizedValueInput({
6969

7070
const handleKeyDown = (e: React.KeyboardEvent) => {
7171
if (e.key === 'Enter') {
72-
;(e.target as HTMLInputElement).blur()
72+
(e.target as HTMLInputElement).blur()
7373
}
7474
}
7575

src/page/setting/components/AdvancedSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const FormItem = Form.Item
1717
function isValidHostname(hostname: string): boolean {
1818
if (!hostname) return false
1919
// 允许: IP地址、域名、localhost
20-
const hostnameRegex = /^[a-zA-Z0-9]([a-zA-Z0-9\-\.]*[a-zA-Z0-9])?$/
20+
const hostnameRegex = /^[a-zA-Z0-9]([a-zA-Z0-9-.]*[a-zA-Z0-9])?$/
2121
return hostnameRegex.test(hostname)
2222
}
2323

src/repositories/__tests__/MountRepository.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ describe('MountRepository', () => {
188188
const result = await repository.addMountConfig(
189189
'test-storage',
190190
'/mnt/test',
191-
{} as any,
191+
{ vfsOpt: {} as any, mountOpt: {} as any },
192192
false
193193
)
194194

@@ -201,13 +201,13 @@ describe('MountRepository', () => {
201201
const { nmConfig } = await import('../../services/ConfigService')
202202

203203
nmConfig.mount.lists = [
204-
{ storageName: 'test-storage', mountPath: '/mnt/test', parameters: {} as any, autoMount: false },
204+
{ storageName: 'test-storage', mountPath: '/mnt/test', parameters: { vfsOpt: {} as any, mountOpt: {} as any }, autoMount: false },
205205
]
206206

207207
const result = await repository.addMountConfig(
208208
'test-storage',
209209
'/mnt/test',
210-
{} as any,
210+
{ vfsOpt: {} as any, mountOpt: {} as any },
211211
false
212212
)
213213

0 commit comments

Comments
 (0)