Skip to content

Commit a3dd2d7

Browse files
committed
fix: handle empty string executable names in swift_package_list
- Fix test failure by treating empty strings as falsy for default naming - Use logical OR instead of nullish coalescing for this specific case - Add ESLint disable comment with explanation for intentional usage - All tests now pass (1602 passing, 3 skipped) - Maintains 100% ESLint compliance (0 errors, 0 warnings)
1 parent c84b02b commit a3dd2d7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/mcp/tools/swift-package/swift_package_list.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ export async function swift_package_listLogic(
5050
const content = [createTextContent(`📋 Active Swift Package processes (${processes.length}):`)];
5151

5252
for (const [pid, info] of processes) {
53-
const executableName = info.executableName ?? 'default';
53+
// Use logical OR instead of nullish coalescing to treat empty strings as falsy
54+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
55+
const executableName = info.executableName || 'default';
5456
const runtime = Math.max(1, Math.round((dateNow() - info.startedAt.getTime()) / 1000));
5557
content.push(
5658
createTextContent(

0 commit comments

Comments
 (0)