Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/showcase/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class ShowcaseApp extends Widget {
if (event.key === 'q' || (event.ctrl && event.key === 'c')) return false;

// Tab switching: 1-5
const num = parseInt(event.key);
const num = parseInt(event.key, 10);
if (num >= 1 && num <= 5) {
this.switchTab(num - 1);
return true;
Expand Down
2 changes: 1 addition & 1 deletion examples/weather/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function fetchWeather() {
}
}

setInterval(fetchWeather, 5000);
clearInterval(window.__interval); window.__interval = setInterval(fetchWeather, 5000);
fetchWeather();

// Gauge does not expose a public setColor() method, so dynamic color
Expand Down
2 changes: 1 addition & 1 deletion examples/widget-gallery/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class WidgetGalleryApp extends Widget {
}

// Tab switching: 1-6
const num = parseInt(event.key);
const num = parseInt(event.key, 10);
if (num >= 1 && num <= 6) {
this._switchTab(num - 1);
return true;
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export class DevServer {

this._killChild();

await exitedPromise.catch(() => {});
await exitedPromise.catch( => console.error());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

if rg -nP 'exitedPromise\.catch\(\s*=>|catch\(\s*=>' packages/dev-server/src/server.ts; then
  echo "Malformed Promise.catch callback remains" >&2
  exit 1
fi

Repository: Karanjot786/TermUI

Length of output: 261


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'File excerpt:\n'
sed -n '375,388p' packages/dev-server/src/server.ts

printf '\nSyntax check with TypeScript if available:\n'
if command -v tsc >/dev/null 2>&1; then
  tmp="$(mktemp -d)/server.ts"
  sed -n '1,420p' packages/dev-server/src/server.ts > "$tmp"
  if tsc --noEmit --strict --target es2022 --module es2022 "$tmp" 2>&1 | grep -n "383"; then
    echo "ERROR"
  else
    echo "No parse error reported at line 383"
  fi
else
  echo "tsc not found"
fi

Repository: Karanjot786/TermUI

Length of output: 920


Fix the malformed .catch callback.

packages/dev-server/src/server.ts:383 has invalid TypeScript syntax: catch is missing an argument expression, so the source does not compile. Pass the rejection value to the callback.

Proposed fix
-            await exitedPromise.catch( => console.error());
+            await exitedPromise.catch((error) => console.error(error));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
await exitedPromise.catch( => console.error());
await exitedPromise.catch((error) => console.error(error));
🧰 Tools
🪛 Biome (2.5.6)

[error] 383-383: Expected a parenthesis '(' but instead found '=>'.

(parse)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dev-server/src/server.ts` at line 383, Fix the malformed catch
callback in the exitedPromise handling by declaring a parameter for the
rejection value, then preserve the existing console.error logging using that
value.

Source: Linters/SAST tools


if (this._running && this._entryFile) {
this._spawnChild();
Expand Down
Loading