Phase 1: Add ESLint/Prettier config + baseline auto-fixes

This commit is contained in:
Krystie
2026-03-22 11:00:25 +01:00
parent 41a0cdee7e
commit e2c67a8fe8
90 changed files with 4008 additions and 3066 deletions

View File

@@ -16,10 +16,10 @@ const LOCK_RETRY_OPTIONS = {
retries: 10,
minTimeout: 100,
maxTimeout: 1000,
randomize: true
randomize: true,
},
stale: LOCK_STALE_THRESHOLD,
realpath: false
realpath: false,
};
class PortLockManager {
@@ -72,7 +72,7 @@ class PortLockManager {
if (!fs.existsSync(lockFilePath)) {
fs.writeFileSync(lockFilePath, JSON.stringify({
created: new Date().toISOString(),
port
port,
}));
}
@@ -89,7 +89,7 @@ class PortLockManager {
this.activeLocks.set(lockId, {
ports: sortedPorts,
releases: releaseFunctions,
timestamp: Date.now()
timestamp: Date.now(),
});
console.log(`[PortLockManager] Successfully acquired all locks (ID: ${lockId})`);
@@ -97,13 +97,13 @@ class PortLockManager {
} catch (error) {
// Release any locks we managed to acquire
console.error(`[PortLockManager] Failed to acquire all locks:`, error.message);
console.error('[PortLockManager] Failed to acquire all locks:', error.message);
for (const release of releaseFunctions) {
try {
await release();
} catch (releaseError) {
console.error(`[PortLockManager] Error releasing lock during cleanup:`, releaseError.message);
console.error('[PortLockManager] Error releasing lock during cleanup:', releaseError.message);
}
}
@@ -132,7 +132,7 @@ class PortLockManager {
await release();
} catch (error) {
errors.push(error.message);
console.error(`[PortLockManager] Error releasing lock:`, error.message);
console.error('[PortLockManager] Error releasing lock:', error.message);
}
}
@@ -198,13 +198,13 @@ class PortLockManager {
lockId,
ports: info.ports,
age: Date.now() - info.timestamp,
timestamp: new Date(info.timestamp).toISOString()
timestamp: new Date(info.timestamp).toISOString(),
}));
return {
activeLocks: activeLocks.length,
locks: activeLocks,
lockDirectory: LOCK_DIR
lockDirectory: LOCK_DIR,
};
}