Skip to content
Open
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
23 changes: 1 addition & 22 deletions examples/cli-wrapper-live/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,4 @@ export function LiveWrapper() {
readStream();

proc.exited.then((code) => {
setStatus(`Process exited with code ${code}`);
if (buffer) {
setLines(prev => [...prev, buffer]);
}
});

return () => {
proc.kill();
};
}, []);

return (
<box width={60} height={20} border="single" flexDirection="column">
<StreamingTextWidget text={status} speed={5} style={{ fg: 'cyan', height: 1 }} />
<box flexGrow={1} border="top">
<LogViewWidget lines={lines} />
</box>
</box>
);
}

renderApp(LiveWrapper);
.catch(err=>console.error(err))

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

Restore the promise expression before .catch.

Line 67 starts with a member-access operator without a receiver. TypeScript cannot parse this file. Attach .catch(...) to the promise returned by the process-start operation, or remove this line if that promise no longer exists.

🧰 Tools
🪛 Biome (2.5.5)

[error] 67-67: Expected a statement but instead found '.catch(err=>console.error(err))'.

(parse)


[error] 67-67: expected } but instead the file ends

(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 `@examples/cli-wrapper-live/src/index.tsx` at line 67, Fix the promise chain in
the process-start flow by restoring the receiver before the `.catch` call at the
affected expression. Attach `.catch(err => console.error(err))` to the promise
returned by the process-start operation, or remove the handler if that operation
no longer returns a promise, ensuring the TypeScript expression parses
correctly.

Source: Linters/SAST tools

4 changes: 2 additions & 2 deletions examples/rss-reader/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ function decodeEntities(value: string): string {

return value.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g, (match, entity: string) => {
if (entity.startsWith('#x')) {
const codePoint = Number.parseInt(entity.slice(2), 16);
const codePoint = Number.parseInt(entity.slice(2,10), 16);
return Number.isFinite(codePoint) ? String.fromCodePoint(codePoint) : match;
}

if (entity.startsWith('#')) {
const codePoint = Number.parseInt(entity.slice(1), 10);
const codePoint = Number.parseInt(entity.slice(1,10), 10);
return Number.isFinite(codePoint) ? String.fromCodePoint(codePoint) : match;
}

Expand Down
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/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
Loading