Skip to content

Commit 877786f

Browse files
committed
chore: remove redundant catch type annotations (useUnknownInCatchVariables is enabled)
1 parent f53213d commit 877786f

19 files changed

Lines changed: 31 additions & 31 deletions

scripts/build.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ async function buildSource(
136136
const buildTime = Date.now() - startTime
137137

138138
return { exitCode: 0, buildTime, result }
139-
} catch (error: unknown) {
139+
} catch (error) {
140140
if (!quiet) {
141141
logger.error('Source build failed')
142142
console.error(error)
@@ -245,7 +245,7 @@ async function watchBuild(options: WatchBuildOptions = {}): Promise<number> {
245245

246246
// Wait indefinitely
247247
await new Promise<never>(() => {})
248-
} catch (error: unknown) {
248+
} catch (error) {
249249
if (!quiet) {
250250
logger.error('Watch mode failed:', error)
251251
}
@@ -473,7 +473,7 @@ async function main(): Promise<void> {
473473
if (exitCode !== 0) {
474474
process.exitCode = exitCode
475475
}
476-
} catch (error: unknown) {
476+
} catch (error) {
477477
logger.error(`Build runner failed: ${getErrorMessage(error)}`)
478478
process.exitCode = 1
479479
}

scripts/bump.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ async function main(): Promise<void> {
923923
logger.substep('2. Create GitHub release if needed')
924924

925925
process.exitCode = 0
926-
} catch (e: unknown) {
926+
} catch (e) {
927927
const message = e instanceof Error ? e.message : String(e)
928928
logger.error(`Version bump failed: ${message}`)
929929
process.exitCode = 1

scripts/check.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ async function main(): Promise<void> {
402402
logger.success('All checks passed')
403403
printFooter()
404404
}
405-
} catch (error: unknown) {
405+
} catch (error) {
406406
logger.error(
407407
`Check runner failed: ${error instanceof Error ? error.message : String(error)}`,
408408
)

scripts/ci-validate.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async function main(): Promise<void> {
7575
logger.success('Build completed')
7676

7777
logger.success('CI validation completed successfully!')
78-
} catch (e: unknown) {
78+
} catch (e) {
7979
const message = e instanceof Error ? e.message : String(e)
8080
logger.error(`CI validation failed: ${message}`)
8181
process.exitCode = 1

scripts/claude.mts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ async function runClaude(
13051305
modelStrategy.recordAttempt(task, true)
13061306

13071307
return result
1308-
} catch (e: unknown) {
1308+
} catch (e) {
13091309
// Record failure for potential escalation
13101310
modelStrategy.recordAttempt(task, false)
13111311

@@ -5033,7 +5033,7 @@ Fix all issues by making necessary file changes. Be direct, don't ask questions.
50335033
if (exitCode !== 0) {
50345034
log.warn(`Claude fix exited with code ${exitCode}`)
50355035
}
5036-
} catch (e: unknown) {
5036+
} catch (e) {
50375037
const message = e instanceof Error ? e.message : String(e)
50385038
log.warn(`Claude fix error: ${message}`)
50395039
} finally {
@@ -5356,7 +5356,7 @@ Fix the issue by making necessary file changes. Be direct, don't ask questions.`
53565356
if (exitCode !== 0) {
53575357
log.warn(`Claude fix exited with code ${exitCode}`)
53585358
}
5359-
} catch (e: unknown) {
5359+
} catch (e) {
53605360
const message = e instanceof Error ? e.message : String(e)
53615361
log.warn(`Claude fix error: ${message}`)
53625362
} finally {
@@ -5562,7 +5562,7 @@ async function runWatchMode(
55625562
} else {
55635563
log.done('No issues found')
55645564
}
5565-
} catch (e: unknown) {
5565+
} catch (e) {
55665566
const message = e instanceof Error ? e.message : String(e)
55675567
log.failed(`Error scanning ${project.name}: ${message}`)
55685568
}
@@ -5596,7 +5596,7 @@ async function runWatchMode(
55965596
},
55975597
)
55985598
}
5599-
} catch (e: unknown) {
5599+
} catch (e) {
56005600
const message = e instanceof Error ? e.message : String(e)
56015601
log.failed(`Full scan error in ${project.name}: ${message}`)
56025602
}
@@ -6005,7 +6005,7 @@ async function main(): Promise<void> {
60056005
}
60066006

60076007
process.exitCode = success ? 0 : 1
6008-
} catch (e: unknown) {
6008+
} catch (e) {
60096009
const message = e instanceof Error ? e.message : String(e)
60106010
log.error(`Operation failed: ${message}`)
60116011
process.exitCode = 1

scripts/clean.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async function cleanDirectories(
8383
logger.done(`Cleaned ${name} (already clean)`)
8484
}
8585
}
86-
} catch (e: unknown) {
86+
} catch (e) {
8787
if (!quiet) {
8888
logger.error(`Failed to clean ${name}`)
8989
const message = e instanceof Error ? e.message : String(e)
@@ -234,7 +234,7 @@ async function main(): Promise<void> {
234234
logger.success('Clean completed successfully!')
235235
}
236236
}
237-
} catch (e: unknown) {
237+
} catch (e) {
238238
const message = e instanceof Error ? e.message : String(e)
239239
logger.error(`Clean runner failed: ${message}`)
240240
process.exitCode = 1

scripts/cover.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ try {
235235
}
236236

237237
process.exitCode = exitCode
238-
} catch (e: unknown) {
238+
} catch (e) {
239239
const message = e instanceof Error ? e.message : String(e)
240240
logger.error(`Coverage script failed: ${message}`)
241241
process.exitCode = 1

scripts/fix.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function run(
4747
logger.warn(`${label || cmd}: exited ${result.code} (non-blocking)`)
4848
}
4949
return 0
50-
} catch (error: unknown) {
50+
} catch (error) {
5151
if (!required) {
5252
logger.warn(`${label || cmd}: ${getErrorMessage(error)} (non-blocking)`)
5353
return 0

scripts/lint.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ async function main(): Promise<void> {
462462
logger.success('All lint checks passed!')
463463
}
464464
}
465-
} catch (error: unknown) {
465+
} catch (error) {
466466
logger.error(
467467
`Lint runner failed: ${error instanceof Error ? error.message : String(error)}`,
468468
)

scripts/publish.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async function runCommand(
8181
...options,
8282
})
8383
return result.code
84-
} catch (e: unknown) {
84+
} catch (e) {
8585
// spawn() throws on non-zero exit
8686
if (e && typeof e === 'object' && 'code' in e) {
8787
return (e as SpawnError).code
@@ -108,7 +108,7 @@ async function runCommandWithOutput(
108108
stderr: result.stderr,
109109
stdout: result.stdout,
110110
}
111-
} catch (e: unknown) {
111+
} catch (e) {
112112
// spawn() throws on non-zero exit
113113
if (
114114
e &&
@@ -442,7 +442,7 @@ async function main(): Promise<void> {
442442
width: 56,
443443
})
444444
process.exitCode = 0
445-
} catch (e: unknown) {
445+
} catch (e) {
446446
const message = e instanceof Error ? e.message : String(e)
447447
logger.error(`Publish runner failed: ${message}`)
448448
process.exitCode = 1

0 commit comments

Comments
 (0)