feat: improve JSDoc with examples and detailed type definitions #13

Merged
irammini merged 5 commits from dev into main 2026-02-06 12:52:33 +00:00
irammini commented 2026-02-06 01:58:19 +00:00 (Migrated from github.com)

V1.2.0

V1.2.0
github-code-quality[bot] (Migrated from github.com) reviewed 2026-02-06 02:25:57 +00:00
@ -151,20 +151,20 @@ export class SnippetPrompt extends Prompt<string, SnippetOptions> {
protected handleInput(char: string, _key: Buffer) {
github-code-quality[bot] (Migrated from github.com) commented 2026-02-06 02:25:57 +00:00

Useless assignment to local variable

The initial value of styledVal is unused, since it is always overwritten.


To fix the problem, we should remove the useless initial assignment and declare styledVal without assigning it until we know which styled string we want. This avoids dead code and preserves behavior.

Concretely, in src/prompts/snippet.ts within the render method, replace the line let styledVal = displayVal; with a declaration that does not assign a value yet, and ensure that both branches of the if (isFocused)/else statement still assign a value to styledVal. For example, change it to let styledVal: string;, leaving the if/else branches as they are. No new imports, methods, or additional definitions are required; this is a local refactor to remove the unused initial value.

## Useless assignment to local variable The initial value of styledVal is unused, since it is always overwritten. --- To fix the problem, we should remove the useless initial assignment and declare <code>styledVal</code> without assigning it until we know which styled string we want. This avoids dead code and preserves behavior.</p> <p>Concretely, in <code>src/prompts/snippet.ts</code> within the <code>render</code> method, replace the line <code>let styledVal = displayVal;</code> with a declaration that does not assign a value yet, and ensure that both branches of the <code>if (isFocused)</code>/<code>else</code> statement still assign a value to <code>styledVal</code>. For example, change it to <code>let styledVal: string;</code>, leaving the <code>if</code>/<code>else</code> branches as they are. No new imports, methods, or additional definitions are required; this is a local refactor to remove the unused initial value.
Sign in to join this conversation.
No description provided.