fix: 修复 CI lint 与前端类型检查报错

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
耗子
2026-06-20 02:13:44 +08:00
parent 4a22299111
commit c2a8200817
2 changed files with 11 additions and 8 deletions
+3 -3
View File
@@ -40,7 +40,7 @@ func isImmutable(path string) bool {
func TestChmodNormalDir(t *testing.T) {
tmpDir, err := os.MkdirTemp("", "test_chmod_normal")
assert.NoError(t, err)
defer os.RemoveAll(tmpDir)
defer func() { _ = os.RemoveAll(tmpDir) }()
sub := filepath.Join(tmpDir, "sub")
assert.NoError(t, os.Mkdir(sub, 0755))
@@ -59,7 +59,7 @@ func TestChmodNormalDir(t *testing.T) {
func TestUnlockRelockAttr(t *testing.T) {
tmpDir, err := os.MkdirTemp("", "test_unlock_attr")
assert.NoError(t, err)
defer os.RemoveAll(tmpDir)
defer func() { _ = os.RemoveAll(tmpDir) }()
locked := filepath.Join(tmpDir, "locked.txt")
normal := filepath.Join(tmpDir, "normal.txt")
@@ -86,7 +86,7 @@ func TestUnlockRelockAttr(t *testing.T) {
func TestChmodWithImmutable(t *testing.T) {
tmpDir, err := os.MkdirTemp("", "test_chmod_immutable")
assert.NoError(t, err)
defer os.RemoveAll(tmpDir)
defer func() { _ = os.RemoveAll(tmpDir) }()
userIni := filepath.Join(tmpDir, ".user.ini")
assert.NoError(t, Write(userIni, "open_basedir=/tmp/", 0644))
+8 -5
View File
@@ -88,8 +88,9 @@ const generateUniqueName = async (fileName: string, reserved: Set<string>): Prom
existsArr = candidates.map(() => false)
}
for (let i = 0; i < batchSize; i++) {
if (!existsArr[i] && !reserved.has(candidates[i])) {
return candidates[i]
const name = candidates[i]
if (name && !existsArr[i] && !reserved.has(name)) {
return name
}
}
offset += batchSize
@@ -178,11 +179,13 @@ const precheckFiles = async (files: File[]): Promise<File[]> => {
const accepted: File[] = []
const conflicts: File[] = []
for (let i = 0; i < files.length; i++) {
const file = files[i]
if (!file) continue
if (existsArr[i]) {
conflicts.push(files[i])
conflicts.push(file)
} else {
uploadPlanMap.set(getFileKey(files[i]), { uploadName: files[i].name, force: false })
accepted.push(files[i])
uploadPlanMap.set(getFileKey(file), { uploadName: file.name, force: false })
accepted.push(file)
}
}