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:
@@ -16,7 +16,7 @@ export type Command =
|
||||
|
||||
export function parseCommand(input: string): Command | null {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) return null;
|
||||
if (!trimmed) {return null;}
|
||||
|
||||
// Quit
|
||||
if (trimmed === '/quit' || trimmed === '/exit') {
|
||||
@@ -65,12 +65,12 @@ export function parseCommand(input: string): Command | null {
|
||||
if (trimmed.startsWith('/model ')) {
|
||||
const args = trimmed.slice('/model '.length).trim();
|
||||
const parts = args.split(/\s+/);
|
||||
|
||||
|
||||
// /model <tier> <provider/model> - change tier's provider/model
|
||||
if (parts.length === 2 && parts[1].includes('/')) {
|
||||
return { type: 'model', name: parts[0], providerModel: parts[1] };
|
||||
}
|
||||
|
||||
|
||||
// /model <name> - single word (backward compatibility)
|
||||
const name = parts[0];
|
||||
return { type: 'model', name };
|
||||
@@ -205,12 +205,12 @@ export const MODEL_TOOLTIPS: Record<string, string> = {
|
||||
|
||||
export function getCommandCompletions(partial: string): string[] {
|
||||
const trimmed = partial.trim();
|
||||
|
||||
|
||||
// Complete /model <tier> <provider/model>
|
||||
if (trimmed.startsWith('/model ')) {
|
||||
const args = trimmed.slice('/model '.length).trim();
|
||||
const parts = args.split(/\s+/);
|
||||
|
||||
|
||||
if (parts.length === 1) {
|
||||
// Single word - suggest model aliases
|
||||
const modelPartial = parts[0].toLowerCase();
|
||||
@@ -225,23 +225,23 @@ export function getCommandCompletions(partial: string): string[] {
|
||||
.map(provider => `/model ${parts[0]} ${provider}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Complete slash commands
|
||||
if (trimmed.startsWith('/')) {
|
||||
return SLASH_COMMANDS.filter(cmd => cmd.startsWith(trimmed.toLowerCase()));
|
||||
}
|
||||
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
export function getCommandTooltip(partial: string): string | null {
|
||||
const trimmed = partial.trim().toLowerCase();
|
||||
|
||||
|
||||
// Tooltip for /model arguments
|
||||
if (trimmed.startsWith('/model ')) {
|
||||
const args = trimmed.slice('/model '.length).trim();
|
||||
const parts = args.split(/\s+/);
|
||||
|
||||
|
||||
if (parts.length === 1) {
|
||||
// Single word - model tier or provider
|
||||
const modelArg = parts[0].toLowerCase();
|
||||
@@ -261,15 +261,15 @@ export function getCommandTooltip(partial: string): string | null {
|
||||
if (matches.length === 1) {
|
||||
return `Enter provider/model (e.g. ${matches[0]}/...)`;
|
||||
}
|
||||
return `Enter provider/model (e.g. anthropic/claude-sonnet-4)`;
|
||||
return 'Enter provider/model (e.g. anthropic/claude-sonnet-4)';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Exact match tooltip
|
||||
if (COMMAND_TOOLTIPS[trimmed]) {
|
||||
return COMMAND_TOOLTIPS[trimmed];
|
||||
}
|
||||
|
||||
|
||||
// Partial match - show tooltip if only one command matches
|
||||
if (trimmed.startsWith('/')) {
|
||||
const matches = SLASH_COMMANDS.filter(cmd => cmd.startsWith(trimmed));
|
||||
@@ -277,7 +277,7 @@ export function getCommandTooltip(partial: string): string | null {
|
||||
return COMMAND_TOOLTIPS[matches[0]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user