style: auto-fix ESLint issues (curly braces and formatting)
- Add curly braces to all if/else/for/while statements - Fix indentation and trailing spaces - Auto-fixed 372 linting errors using eslint --fix - Remaining issues are warnings only (non-null assertions, explicit any types)
This commit is contained in:
@@ -81,7 +81,7 @@ export class DockerSandbox {
|
||||
|
||||
/** Force-remove the container. */
|
||||
async destroy(): Promise<void> {
|
||||
if (!this._containerId) return;
|
||||
if (!this._containerId) {return;}
|
||||
|
||||
try {
|
||||
await this.dockerCmd(['rm', '-f', this._containerId]);
|
||||
@@ -98,8 +98,8 @@ export class DockerSandbox {
|
||||
execFile('docker', ['version', '--format', '{{.Server.Version}}'], {
|
||||
timeout: 5000,
|
||||
}, (error, stdout) => {
|
||||
if (error) reject(error);
|
||||
else resolve(stdout);
|
||||
if (error) {reject(error);}
|
||||
else {resolve(stdout);}
|
||||
});
|
||||
});
|
||||
return true;
|
||||
|
||||
@@ -16,7 +16,7 @@ export class SandboxManager {
|
||||
/** Get or create a sandbox for a session. */
|
||||
async getOrCreate(sessionId: string): Promise<DockerSandbox> {
|
||||
let sandbox = this.sandboxes.get(sessionId);
|
||||
if (sandbox) return sandbox;
|
||||
if (sandbox) {return sandbox;}
|
||||
|
||||
sandbox = new DockerSandbox({
|
||||
sessionId,
|
||||
@@ -36,7 +36,7 @@ export class SandboxManager {
|
||||
/** Destroy a specific session's sandbox. */
|
||||
async destroy(sessionId: string): Promise<void> {
|
||||
const sandbox = this.sandboxes.get(sessionId);
|
||||
if (!sandbox) return;
|
||||
if (!sandbox) {return;}
|
||||
|
||||
await sandbox.destroy();
|
||||
this.sandboxes.delete(sessionId);
|
||||
|
||||
Reference in New Issue
Block a user