Skip to content

Commit 1770f5b

Browse files
committed
Fix lint
1 parent 54f6611 commit 1770f5b

File tree

3 files changed

+38
-36
lines changed

3 files changed

+38
-36
lines changed

src/extension/providers/StressViewProvider.ts

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -379,37 +379,40 @@ export default class extends BaseViewProvider<typeof ProviderMessageSchema, Webv
379379
const judgeState = ctx.state.find((s) => s.state === "Judge")!;
380380

381381
const addCompileTask = (state: State, filePath: string): Promise<CompilationResult> => {
382-
return new Promise(async (resolve) => {
383-
const compilePromise = compile(filePath, this._context);
384-
if (!compilePromise) {
385-
resolve({ code: 0, stdout: "", stderr: "" });
386-
return;
387-
}
388-
if (this._currentFile === file) {
389-
super._postMessage({
390-
type: "STATUS",
391-
id: state.state,
392-
status: "COMPILING",
393-
});
394-
state.stdout.reset();
395-
state.stderr.reset();
396-
}
397-
const res = await compilePromise;
398-
if (res.code !== 0) {
399-
state.status = "CE";
400-
state.stdout.write(res.stdout, "final");
401-
state.stderr.write(res.stderr, "final");
402-
if (this._currentFile === file) {
403-
super._postMessage({ type: "STATUS", id: state.state, status: "CE" });
404-
}
405-
} else {
406-
state.status = "NA";
407-
if (this._currentFile === file) {
408-
super._postMessage({ type: "STATUS", id: state.state, status: "NA" });
382+
const compilePromise = compile(filePath, this._context);
383+
if (!compilePromise) {
384+
return Promise.resolve({ code: 0, stdout: "", stderr: "" });
385+
}
386+
if (this._currentFile === file) {
387+
super._postMessage({
388+
type: "STATUS",
389+
id: state.state,
390+
status: "COMPILING",
391+
});
392+
state.stdout.reset();
393+
state.stderr.reset();
394+
}
395+
return compilePromise
396+
.then((res) => {
397+
if (res.code !== 0) {
398+
state.status = "CE";
399+
state.stdout.write(res.stdout, "final");
400+
state.stderr.write(res.stderr, "final");
401+
if (this._currentFile === file) {
402+
super._postMessage({ type: "STATUS", id: state.state, status: "CE" });
403+
}
404+
} else {
405+
state.status = "NA";
406+
if (this._currentFile === file) {
407+
super._postMessage({ type: "STATUS", id: state.state, status: "NA" });
408+
}
409409
}
410-
}
411-
resolve(res);
412-
});
410+
return res;
411+
})
412+
.catch((err) => {
413+
getLogger("stress").error(`Compile task rejected: ${err}`);
414+
return { code: 1, stdout: "", stderr: `${err}` };
415+
});
413416
};
414417

415418
super._postMessage({

src/extension/utils/vscode.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ReadonlyTerminal implements vscode.Pseudoterminal {
3939

4040
constructor(private content: string) {}
4141

42-
open(_initialDimensions: vscode.TerminalDimensions | undefined): void {
42+
open(): void {
4343
// Normalize newlines for terminal (LF -> CRLF)
4444
const normalized = this.content.replace(/\r?\n/g, "\r\n");
4545
this.writeEmitter.fire(normalized);
@@ -354,10 +354,8 @@ function resolveArrayVariables(
354354
function resolveObjectVariables(
355355
obj: Record<string, unknown>,
356356
inContextOfFile?: string,
357-
extraVariables?: Record<string, string>,
358-
propertyPath?: string
357+
extraVariables?: Record<string, string>
359358
): Record<string, unknown> {
360-
void propertyPath; // suppress eslint
361359
const result: Record<string, unknown> = {};
362360
for (const [key, val] of Object.entries(obj)) {
363361
// Pass the current key as propertyName to child resolution
@@ -397,8 +395,7 @@ export function resolveVariables(
397395
return resolveObjectVariables(
398396
value as Record<string, unknown>,
399397
inContextOfFile,
400-
extraVariables,
401-
propertyName
398+
extraVariables
402399
);
403400
}
404401
if (typeof value === "string") {

src/webview/AutoresizeTextarea.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@
262262
}
263263
}}
264264
>
265+
<!-- Safe: ansi-to-html has escapeXML:true which prevents XSS by escaping HTML entities -->
266+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
265267
{@html htmlValue}
266268
</div>
267269
{:else}

0 commit comments

Comments
 (0)